473,404 Members | 2,179 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,404 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 3381
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.