PDA

View Full Version : ASP redirect to new page


nasos007
11-14-2002, 05:42 PM
Hi All,

I am using ASP and ASP.NET on a page with frames.

I have a form on the right frame, but if the session times out, I want to break out of the frames. [does this make sense???]

I am using the line below, but I want it to open in the parent window=

Response.Redirect("default.aspx", True)


My questions:
Is this possible? and how?

Your time in helping me is greatly appreciated!
Nas:confused:

Roelf
11-14-2002, 06:52 PM
no, the server has absolutely no knowledge of the location in the frameset of the page it is currently processing. This sort of things you have to take care of in the browser -> client side

whammy
11-15-2002, 12:20 AM
You can't determine a Session.Timeout from the client-side. What you CAN do is start a timer in javascript when the page is loaded... and if that timer gets to 20 minutes (assuming you're using the default Session.Timeout), break out of frames at that point, and replace the window.location with whatever you want, instead of trying to redirect server-side.

Trying to redirect on the server will not work, since the client has not requested anything from the server.

If they did, then the session would not time out, since Session.Timeout would be reset.

I hope that makes sense, but that's really the wrong way to go about the whole thing... probably you want to present them with a new page if they make a request to the server after the session has timed out.