Here's a code sample for redirection. You'll be most interested in the line
reading "FormsAuthentication.RedirectFromLoginPage(... )" under step 4:
http://msdn.microsoft.com/library/de...entication.asp.
Also, take a look at the documentation for the FormsAuthentication class
(
http://msdn.microsoft.com/library/de...-us/cpref/html
/frlrfsystemwebsecurityformsauthenticationmembersto pic.asp) for more
information regarding the RedirectFromLoginPage() method.
I've not used forms authentication extensively but I played with it a while
back. If memory (and a little reading) serves me correctly, when accessing
a site under forms authentication, the user is redirected from the page
being requested to the login page. Upon successful
authentication/authorization, the RedirectFromLoginPage() method will return
the user to the originally requested page. You can check the value returned
by the GetRedirectUrl() method to determine which page was originally
requested and determine from there if you should use RedirectFromLoginPage()
or Response.Redirect (or Server.Transfer).
"Grey" <er*******@i-cable.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
I have set the following parameters in web.config to prevent user direct
access the web page without user login.
<authentication mode="Forms">
<forms loginUrl="Initial/index.aspx" name="adAuthCookie"
timeout="60" path="/" >
</forms>
</authentication>
The application did success to redirect to login page, but it cannot
redirect back to desire page which I specify in URL. What's wrong with my
setting or do i need to add some code in the aspx file??
Million Thanks