473,498 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3385
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
946
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
1175
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
1986
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
284
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
6997
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
2020
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
3483
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
2520
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
2223
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
3426
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
7002
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
7165
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,...
1
6887
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
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.