I'm sure that this is possible, just can't seem to get it to work. Within a ASP.Net page I have a datagrid. Within that datagrid I want to redirect the user to an edit page, sending the 'index' key along with the address using javascript.
I've successfully opened a new window with a querystring with no problems.
(Code Behind) - ItemBoundData Sub
(Javascript)
This works great, the only problem is that I don't want it to open a new window, rather redirect to a new page within the same window.
Heres my last attempt at openning in the same window:
(Code Behind) - ItemBoundData Sub
(Javascript)
What I'm doing wrong I couldn't tell you, please help...
Thanks,
t
I've successfully opened a new window with a querystring with no problems.
(Code Behind) - ItemBoundData Sub
Code:
If e.Item.Cells(0).Controls.Count > 0 Then ' Edit Link
If TypeOf (e.Item.Cells(0).Controls(0)) Is LinkButton Then
Dim btnView As LinkButton = CType(e.Item.Cells(0).Controls(0), LinkButton)
btnView.Attributes("onclick") = "OpenForm('Viewer.aspx?var0=" & e.Item.Cells(1).Text & "','width=800,height=600,resizable=yes,scrollbars=yes');"
End If
End If
(Javascript)
Code:
<script language="javascript" type="text/javascript">
function OpenForm(strURL,strFeatures)
{
window.open(strURL,'',strFeatures);
}
</script>
This works great, the only problem is that I don't want it to open a new window, rather redirect to a new page within the same window.
Heres my last attempt at openning in the same window:
(Code Behind) - ItemBoundData Sub
Code:
If e.Item.Cells(0).Controls.Count > 0 Then ' View Link
If TypeOf (e.Item.Cells(0).Controls(0)) Is LinkButton Then
Dim btnView As LinkButton = CType(e.Item.Cells(0).Controls(0), LinkButton)
btnView.Attributes("onclick") = "RedirectForm('Viewer.aspx?var0=" & e.Item.Cells(1).Text & "');"
End If
End If
(Javascript)
Code:
<script language="javascript" type="text/javascript">
function RedirectForm(strURL)
{
window.location=strURL;
}
</script>
What I'm doing wrong I couldn't tell you, please help...
Thanks,
t