G
Guest
Hello!
I have written a javascript which posts back a page with __doPostBack if a
user presses the escape-button on the keyboard. Then in Page_Load I´m doing a
response.redirect to another page.
This scripts only works for me if the page (which had the page_load with the
response.redirect) is in a frameset environment. If the page is not in
frameset, then the postback works fine but nothing happens when doing
response.redirect.
Why is that?
My code:
document.onkeydown=function MyRedirect()
{
if(event.keyCode == 27)
{
__doPostBack('', 'myRedirect');
}
}
--
The doPostBack method is autogenerated by .net. I´m using .net 2.0.
--
VB.Net code:
-------------
Private Sub Page_Load(...) Handles Me.Load
If Request.Form("__EVENTARGUMENT") = "myRedirect" Then
response.redirect("anotherPage.aspx")
End If
End Sub
Thanks in advance
/ Stefan
I have written a javascript which posts back a page with __doPostBack if a
user presses the escape-button on the keyboard. Then in Page_Load I´m doing a
response.redirect to another page.
This scripts only works for me if the page (which had the page_load with the
response.redirect) is in a frameset environment. If the page is not in
frameset, then the postback works fine but nothing happens when doing
response.redirect.
Why is that?
My code:
document.onkeydown=function MyRedirect()
{
if(event.keyCode == 27)
{
__doPostBack('', 'myRedirect');
}
}
--
The doPostBack method is autogenerated by .net. I´m using .net 2.0.
--
VB.Net code:
-------------
Private Sub Page_Load(...) Handles Me.Load
If Request.Form("__EVENTARGUMENT") = "myRedirect" Then
response.redirect("anotherPage.aspx")
End If
End Sub
Thanks in advance
/ Stefan