473,396 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

RedirectFromLoginPage

I am trying to code a workaround to avoid being redirected to default.aspx
if the ReturnURL parameter is blank when the RedirectFromLoginPage method is
called.
Depending upon the login status the login button performs either a login or
logout and the appropriate image is displayed, see below:

'************************************************* ******
' Displays the applicable image
'************************************************* ******
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Request.IsAuthenticated = true Then
imgSignInOut.ImageUrl="images/signout.gif"
End If
End Sub
Interestingly before I altered the code and simply used the code below after
the user completed a login everything worked perfectly:
FormsAuthentication.RedirectFromLoginPage(customer Id,
RememberLogin.Checked)
If I check the value of ReturnUrl and do a manual redirect if blank using
the code below Request.IsAuthenticated remains false and as a result the
page load event above always displays the login image...
If Request.QueryString("ReturnUrl") ="" Then
Response.Redirect("./")
Else
FormsAuthentication.RedirectFromLoginPage(customer Id,
RememberLogin.Checked)
End if
Any ideas ?

Thanks

Murphy
Nov 18 '05 #1
1 3380
Cowboy (Gregory Beamer) has a kludge:
http://groups.google.com/groups?hl=e...2Bdefault.aspx

Alternatively, you could just create the ticket and set the cookie manually,
as well as do all redirection manually. You need to do this anyways to use
UserData (which I'm sure you can find a use for in your app).

-mike
MVP

"Murphy" <mu****@murphy.com> wrote in message
news:ud*************@TK2MSFTNGP12.phx.gbl...
I am trying to code a workaround to avoid being redirected to default.aspx
if the ReturnURL parameter is blank when the RedirectFromLoginPage method
is
called.
Depending upon the login status the login button performs either a login
or
logout and the appropriate image is displayed, see below:

'************************************************* ******
' Displays the applicable image
'************************************************* ******
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Request.IsAuthenticated = true Then
imgSignInOut.ImageUrl="images/signout.gif"
End If
End Sub
Interestingly before I altered the code and simply used the code below
after
the user completed a login everything worked perfectly:
FormsAuthentication.RedirectFromLoginPage(customer Id,
RememberLogin.Checked)
If I check the value of ReturnUrl and do a manual redirect if blank using
the code below Request.IsAuthenticated remains false and as a result the
page load event above always displays the login image...
If Request.QueryString("ReturnUrl") ="" Then
Response.Redirect("./")
Else
FormsAuthentication.RedirectFromLoginPage(customer Id,
RememberLogin.Checked)
End if
Any ideas ?

Thanks

Murphy


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rob O'Cop | last post by:
Hi, I've got an Intranet site that's been using the usual Forms authentication. Now, I want to retrieve the Windows Login and authenticate the user automatically without her typing...
0
by: Andres Romero | last post by:
I have a login web form named login.aspx, wich validates user from a database. I configure the Web.config file to it authenticates using Form mode, and when the user try acces other page than...
2
by: Gan | last post by:
Hi, I just wonder after calling the RedirectFromLoginPage function, my current page still stick to login.aspx fiile. Any clue?? Thanks
1
by: Murphy | last post by:
I am trying to code a workaround to avoid being redirected to default.aspx if the ReturnURL parameter is blank when the RedirectFromLoginPage method is called. Depending upon the login status the...
2
by: Ben Fidge | last post by:
Is FormsAuthentication.RedirectFromLoginPage the only way to populate the HttpContext.Current.User.Identity.Name property? A base class for each page contains the follwoing property: public...
2
by: Rob O'Cop | last post by:
Hi, I've got an Intranet site that's been using the usual Forms authentication. Now, I want to retrieve the Windows Login and authenticate the user automatically without her typing...
2
by: tshad | last post by:
I have a logon page that is may be called by the Forms Authentication setup. This would put a ReturnURL as part of the URL. I would normally then just issue a: ...
8
by: Andy Sutorius | last post by:
Hi, For some reason the login.aspx webpage redirects to itself after a successful login and not to the url in the address bar. I have stepped through this with debug and it behaves as it is...
8
by: Edward Mitchell | last post by:
I have a main project that is protected in that the user is directed to a login.aspx file. The text in the web.config file is: <authentication mode="Forms"> <forms loginUrl="Login.aspx" />...
4
by: jjjooooohhnnn | last post by:
Greetings, I have encountered what appears to be a fairly common problem: RedirectFromLoginPage is not redirecting to RedirectUrl. I have tried all the advice that I could on the 'net, and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.