Redirecting in ASP.NET 2.0

C

chris fellows

I have a generic authentication web page Authentication.aspx that is used by
other web pages to authenticate the user if their application session has
expired after N minutes since they last logged in.

PageA.aspx redirects to PageB.aspx. PageB.aspx (in Page_Load) then redirects
to Authentication.aspx. Some Javascript in Authentication.aspx checks if the
application session has expired and, if so, authenticates the user's
username & password. The Javascript then sets window.location to return to
PageB.aspx so that the user can continue.

For each web page, how do I ensure that the Authentication page only gets
shown on the first Page_Load for the user? The Javascript window.location
method seems to cause ASP.NET to create a new instance of PageB.aspx and not
return to the instance that original redirected them to Authentication.aspx.
This causes PageB.aspx to constantly redirect to Authentication.aspx.

(Please don't recommend using the ASP.NET 2 Login controls for
authentication. I am well aware that they exist!!!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top