Ask a Question related to ASP.NET General, Design and Development.
-
TaeHo Yoo #1
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
-
FormsAuthentication.RedirectFromLoginPage And Frames
Hi! I have a page called Login.aspx that handles login (takes username, pass and compares to a database). If the user is authenticated,... -
FormsAuthentication system dsn odbc error
I have an asp.net application which uses FormsAuthentication. I have a reference to a vb6 dll (updateSage). I pass to the updateSage.dll values to... -
Problem with FormsAuthentication.RedirectFromLoginPage
I am having problem with redirection from http-https-http First an http application gets redirected to https application for authentication... -
FormsAuthentication.RedirectFromLoginPage is not passed fully qualified url
I have two web applications on the same server: http://localhost/ModemUpgrade and http://localhost/TestFormAuth The web.config of... -
RedirectFromLoginPage(username, true) no working
Hi, I just wonder after calling the RedirectFromLoginPage function, my current page still stick to login.aspx fiile. Any clue?? Thanks -
Teemu Keiski #2
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]joteke@aspalliance.com[/email]
"TaeHo Yoo" <anonymous@devdex.com> kirjoitti viestissä
news:OiTGz%23cRDHA.1304@TK2MSFTNGP11.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



Reply With Quote

