get redirect url before login

F

feng

My users who try to access a page before login are
redirected to my login page. Then after they successfully
login, my login page will redirect the user to the page
they intended to go through this line:

FormsAuthentication.RedirectFromLoginPage(strUserName,
False)

What I want now is that I want to capture the origional
url that the use intented to go BEFORE the user logs in. I
don't mind to do this in the login page, but this has to
be done in the page load, before the user's login info
typed in.

I know there is a function:

FormsAuthentication.GetRedirectUrl(strUserName, False)

but this won't work for me because it expect user name.

Any ideas?

Thanks a million!
 
I

Igor

I suggest using HTTP Module for authentication and authorization. If
you implement HTTP module by including a special line in webconfig,
all requests will go through one central place where you will be doing
the authentication and authorization. All of the pages in your app
will not have to worry about authorization or athentication, because
you can handle it all the way you want in one function. You can
inspect every incoming request and redirect people to login page and
save their original requested page and do it in any way you like,
using either cookies or session or a combination of two.

Request.QueryString["ReturnUrl"]

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com


feng said:
My users who try to access a page before login are
redirected to my login page. Then after they successfully
login, my login page will redirect the user to the page
they intended to go through this line:

FormsAuthentication.RedirectFromLoginPage(strUserName,
False)

What I want now is that I want to capture the origional
url that the use intented to go BEFORE the user logs in. I
don't mind to do this in the login page, but this has to
be done in the page load, before the user's login info
typed in.

I know there is a function:

FormsAuthentication.GetRedirectUrl(strUserName, False)

but this won't work for me because it expect user name.

Any ideas?

Thanks a million!
 

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
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top