473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

__doPostBack and Response.direct not working in non-framed pages.

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
Nov 19 '05 #1
0 1373

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Frankieboy | last post by:
Where is __doPostBack-function defined? I've got an application which generates a different __doPostBack-function when the code is being run on the server compared to the one on my laptop. The...
1
by: paul reed | last post by:
Hello, I am having some weird behavior between two machines...one which is running the 1.1 framework and one which is running 1.0. After opening a child form from a parent...I update the...
15
by: Steven Livingstone | last post by:
I am running into the "colon in javascript" problem as discussed here http://www.bdragon.com/entries/000324.shtml. Basically, i have nested controls and get the error on a line such as : ...
2
by: Bruce W.1 | last post by:
I have a web page (called Page1) with an iFrame and a button on it. The URL for the iFrame is another page, lets call it Page2. On Page1 I tack a querystring onto the Page2 URL. The querystring...
1
by: Adrian | last post by:
I appear to be losing ViewState information when calling the __doPostBack function. I am attempting to use the showModalDialog to load a new web page which confirms that a user wishes to save a...
0
by: AJP | last post by:
I have a child window which does the following after a button is pressed: Response.Write("<script>window.opener.__doPostBack('','');</script>"); but I get the following uncaught exception upon...
0
by: AJP | last post by:
I have a child window which does the following after a button is pressed: Response.Write("<script>window.opener.__doPostBack('','');</script>"); but I get the following uncaught exception upon...
3
by: Marcelo | last post by:
Hello, I am trying to create a postback event, and it is working, just not calling the sub. I have a datagrid which has <asp:DataGrid id="Mensajes" ... <Columns> <asp:HyperLinkColumn ....
2
by: SteveSu | last post by:
Hi! I want to make a postback when the user hits the escape-button on the keyboard and redirect the user to another page. But the response.redirect does not work for me in this "context". I´m...
0
by: AncaT | last post by:
Hi, I have just started working w/ asp.net, vb.net. I have a .aspx page that contains user defined controls. Inside these controls, I have a 'Delete' hyperlink. This is the code: Inside...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.