Re: forms authentication redirect problem.



Hi,

RedirectToLoginPage looks for the returnUrl query parameter. If none is there you have to do the redirect on your own

a) You should check for null not "" on the query string
b) use FormsAuthentication.SetAuthCookie and do the redirect manually to decouple what Rtlp does

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Hi i've made a loginpage and a protected one. If the user tries to
enter the protected page he gets redirected to the loginpage and at
this point everything works fine.

But when the user goes directly to the loginpage and types his pasword
it fails to login.

it tried to solve this with following code but this doesn't work
properly

if(Request.Querystring ("ReturnUrl")= "" ) then
Response.redirect("reservatie.aspx")
lblResult.Text = "juist maar niet ingelogd"
else
FormsAuthentication.RedirectFromLoginPage (TextBox1.Text, True)
end if
Anyone an idea what i have to change to get this to work.

Thanks



.



Relevant Pages

  • Re: Default.aspx - newbie Q`
    ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Default.aspx - newbie Q`
    ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: doesnt redirect
    ... Look under the Security tab. ... One of them is called the Internet zone and probably the one you are using. ... or better explain what you mean by>> redirect ... I think there are 2 interstitchal pages after submitting those login credentials before you get to the mailbox web page. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Accessing and displaying SSL web pages and cookies from a windows form
    ... or LoadXML calls to urls on the website in order to get data or post data to ... first redirected to a SSL login page, if a particular cookie is not present, ... cookie is not present instead of getting the data. ... >> the data in the cookie and also not redirect to the login page. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Login problem
    ... redirect the user. ... Samuel Shulman wrote: ... Use either Forms Authentication or Basic Authentication. ... If the user types in the url the Login.aspx file then enters the username and the password, clicks the login button and the form validates the values against values from the database ...
    (microsoft.public.dotnet.framework.aspnet)