Results 1 to 5 of 5

Thread: Form Authentication

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    Unhappy Form Authentication

    I am tring to authenticate my web application forms.If any user tried to access any page then s/he should redirect to login page.
    for that I have change
    >> my web.config files as :


    <authentication mode="Forms">
    <forms loginUrl="Login.aspx" name="Login">
    </forms>
    </authentication>
    <authorization>
    <deny users="?"/>
    </authorization>


    But my purpoise doesn't solved.Can anybody correct my mistake.
    Help Expected.

    Pankaj

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    You are missing the location to protect
    PHP Code:
    <location path="mypage.aspx"> [This can also be a folder]
        <
    system.web>
            <
    authorization>
                <
    deny users="?" />
            </
    authorization>
        </
    system.web>
    </
    location

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    Ok !!

    Ok fine ..But after successfully login I want to rediect to the page where from I came how do that .I am writing following code :

    FormsAuthentication.RedirectFromLoginPage("Ok",false);

    any changes to this code required.

    Please reply..


    PPCC

  4. #4
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256

    Re: Ok !!

    Originally posted by PPCC
    Ok fine ..But after successfully login I want to rediect to the page where from I came how do that .I am writing following code :

    FormsAuthentication.RedirectFromLoginPage("Ok",false);

    any changes to this code required.

    Please reply..


    PPCC
    Why would you want to go back to the page you are comming from after login? That defeats the purpose of logging in.
    Anyway you can do it like this
    Code:
    FormsAuthentication.SetAuthCookie("Ok", false);
    Response.Redirect("mypage.aspx");

  5. #5
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    I have 3 web forms:
    Login.aspx
    Main.aspx
    Feedback.aspx

    I have forms security switched on and people MUST login 1st.

    What I can't get it to do is ALLOW anon access to the feedback web form....how can I do this, but set form authentication for the rest of the site?
    I know it has something to do with:
    Code:
    <location path="mypage.aspx"> [This can also be a folder] 
        <system.web> 
            <authorization> 
                <deny users="?" /> 
            </authorization> 
        </system.web> 
    </location>
    Anyone?

    Woof

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width