2. create login.aspx and default.aspx 3. add this line in login.aspx for submit click event Dim theUser As New Online_Employment_Manager_Business.User() If theUser.Login(txtUserName.Text, txtPassword.Text)Then System.Web.Security.FormsAuthentication.RedirectFromLoginPage(txtUserNam e.Text, True) Else 'Login failed - show the message Page.RegisterStartupScript("LoginFailed", "") End If although theUser.Login passed True the page remains in login.aspx. Did I miss something? Thanks *** Sent via Developersdex [url]http://www.developersdex.com[/url] *** Don't just participate in USENET...get rewarded for it! [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => TaeHo Yoo [ip] => anonymous@devde [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> denies all access to the protected pages, despite is the user authenticated or not. It should be: In this case only unauthenticated users are redirected to the login page. -- Teemu Keiski MCP,Designer/Developer Mansoft tietotekniikka Oy [url]http://www.mansoft.fi[/url] ASP.NET Forums Moderator, [url]www.asp.net[/url] AspAlliance Columnist, [url]www.aspalliance.com[/url] Email: [email]joteke@aspalliance.com[/email] "TaeHo Yoo" kirjoitti viestissä news:OiTGz%23cRDHA.1304@TK2MSFTNGP11.phx.gbl...[quote] > Thanks in advance, > > What I did was > > 1. add these lines in web.cofig file > > protection="All" path="/" /> > > > > > > 2. create login.aspx and default.aspx > 3. add this line in login.aspx for submit click event > Dim theUser As New Online_Employment_Manager_Business.User() > > If theUser.Login(txtUserName.Text, txtPassword.Text)Then > System.Web.Security.FormsAuthentication.RedirectFromLoginPage(txtUserNam > e.Text, True) > Else > 'Login failed - show the message > Page.RegisterStartupScript("LoginFailed", "") > End If > > although theUser.Login passed True the page remains in login.aspx. > > Did I miss something? > > Thanks > > > *** Sent via Developersdex [url]http://www.developersdex.com[/url] *** > Don't just participate in USENET...get rewarded for it![/quote] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Teemu Keiski [ip] => joteke@aspallia [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> System.Web.Security.FormsAuthentication.RedirectFr omLoginPage is not working.. - ASP.NET General

System.Web.Security.FormsAuthentication.RedirectFr omLoginPage is not working.. - ASP.NET General

Thanks in advance, What I did was 1. add these lines in web.cofig file <authentication mode="Forms"> <forms name="frmAuthentication" loginUrl="login.aspx" protection="All" path="/" /> </authentication> <authorization> <deny users="*" /> <!-- Allow all users --> </authorization> 2. create login.aspx and default.aspx 3. add this line in login.aspx for submit click event Dim theUser As New Online_Employment_Manager_Business.User() If theUser.Login(txtUserName.Text, txtPassword.Text)Then System.Web.Security.FormsAuthentication.RedirectFr omLoginPage(txtUserNam e.Text, True) Else 'Login failed - show the message Page.RegisterStartupScript("LoginFailed", "<script language=""JavaScript"">alert('Login Failed.\n\nPlease check your login information and try again.');</script>") End If although theUser.Login passed True the page remains in login.aspx. Did I miss something? Thanks *** Sent via Developersdex [url]http://www.developersdex.com[/url] *** ...

  1. #1

    Default System.Web.Security.FormsAuthentication.RedirectFr omLoginPage is not working..

    Thanks in advance,

    What I did was

    1. add these lines in web.cofig file
    <authentication mode="Forms">
    <forms name="frmAuthentication" loginUrl="login.aspx"
    protection="All" path="/" />
    </authentication>
    <authorization>
    <deny users="*" /> <!-- Allow all users -->
    </authorization>

    2. create login.aspx and default.aspx
    3. add this line in login.aspx for submit click event
    Dim theUser As New Online_Employment_Manager_Business.User()

    If theUser.Login(txtUserName.Text, txtPassword.Text)Then
    System.Web.Security.FormsAuthentication.RedirectFr omLoginPage(txtUserNam
    e.Text, True)
    Else
    'Login failed - show the message
    Page.RegisterStartupScript("LoginFailed", "<script
    language=""JavaScript"">alert('Login Failed.\n\nPlease check your login
    information and try again.');</script>")
    End If

    although theUser.Login passed True the page remains in login.aspx.

    Did I miss something?

    Thanks


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    TaeHo Yoo Guest

  2. #2

    Default Re: System.Web.Security.FormsAuthentication.RedirectFr omLoginPage is not working..

    You have error in the web.config.

    This setting:
    <authorization>
    <deny users="*" /> <!-- Allow all users -->
    </authorization>

    denies all access to the protected pages, despite is the user authenticated
    or not. It should be:

    <authorization>
    <deny users="?" /> <!-- Allow authenticated users -->
    </authorization>

    In this case only unauthenticated users are redirected to the login page.

    --
    Teemu Keiski
    MCP,Designer/Developer
    Mansoft tietotekniikka Oy
    [url]http://www.mansoft.fi[/url]

    ASP.NET Forums Moderator, [url]www.asp.net[/url]
    AspAlliance Columnist, [url]www.aspalliance.com[/url]

    Email:
    [email]jotekeaspalliance.com[/email]

    "TaeHo Yoo" <anonymousdevdex.com> kirjoitti viestissä
    news:OiTGz%23cRDHA.1304TK2MSFTNGP11.phx.gbl...
    > Thanks in advance,
    >
    > What I did was
    >
    > 1. add these lines in web.cofig file
    > <authentication mode="Forms">
    > <forms name="frmAuthentication" loginUrl="login.aspx"
    > protection="All" path="/" />
    > </authentication>
    > <authorization>
    > <deny users="*" /> <!-- Allow all users -->
    > </authorization>
    >
    > 2. create login.aspx and default.aspx
    > 3. add this line in login.aspx for submit click event
    > Dim theUser As New Online_Employment_Manager_Business.User()
    >
    > If theUser.Login(txtUserName.Text, txtPassword.Text)Then
    > System.Web.Security.FormsAuthentication.RedirectFr omLoginPage(txtUserNam
    > e.Text, True)
    > Else
    > 'Login failed - show the message
    > Page.RegisterStartupScript("LoginFailed", "<script
    > language=""JavaScript"">alert('Login Failed.\n\nPlease check your login
    > information and try again.');</script>")
    > End If
    >
    > although theUser.Login passed True the page remains in login.aspx.
    >
    > Did I miss something?
    >
    > Thanks
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Teemu Keiski Guest

Similar Threads

  1. FormsAuthentication.RedirectFromLoginPage And Frames
    By Johan Karlsson in forum ASP.NET Security
    Replies: 4
    Last Post: February 1st, 07:24 AM
  2. FormsAuthentication system dsn odbc error
    By Michael S. in forum ASP.NET Security
    Replies: 3
    Last Post: January 6th, 09:41 AM
  3. Problem with FormsAuthentication.RedirectFromLoginPage
    By Holysmoke in forum ASP.NET Security
    Replies: 0
    Last Post: September 30th, 11:25 AM
  4. Replies: 0
    Last Post: April 2nd, 02:47 PM
  5. RedirectFromLoginPage(username, true) no working
    By Gan in forum ASP.NET General
    Replies: 2
    Last Post: June 27th, 06:48 AM

Bookmarks

Posting Permissions

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