Cannot redirect to desire page

Discussion in 'ASP .Net' started by Grey, Aug 3, 2004.

  1. Grey

    Grey Guest

    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
    Grey, Aug 3, 2004
    #1
    1. Advertising

  2. Grey

    Dave Fancher Guest

    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/d...uide/html/cpconsimplecookieauthentication.asp.

    Also, take a look at the documentation for the FormsAuthentication class
    (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html
    /frlrfsystemwebsecurityformsauthenticationmemberstopic.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" <> wrote in message
    news:%...
    > 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
    >
    >
    >
    Dave Fancher, Aug 3, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Au
    Replies:
    2
    Views:
    466
    Joe Au
    Aug 8, 2004
  2. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,235
    Srowe1975
    Oct 15, 2008
  3. Carlos

    cannot redirect to mobile page

    Carlos, Dec 9, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,520
    Carlos
    Dec 9, 2004
  4. Victor Bazarov

    FAQ and our desire to answer questions

    Victor Bazarov, Feb 2, 2004, in forum: C++
    Replies:
    4
    Views:
    332
    E. Robert Tisdale
    Feb 3, 2004
  5. Sal
    Replies:
    1
    Views:
    408
Loading...

Share This Page