?
Solved

Forms Authentication - RedirectFromLoginPage Is Null

Posted on 2004-04-16
3
Medium Priority
?
371 Views
Last Modified: 2012-06-21
I have a question which nobody seems to be able to answer - even the teacher on the ASP.NET course I have recently been on.

When using forms authentication, if the user manages to navigate himself straight to the login page, RedirectFromLoginPage is null and after a successful login it goes to the root default.aspx, even if you dont want it to!!! And you cant seem to change this.  So my question is, can you change this?  I want it to go the sub folder default.aspx, not the root default.aspx.

0
Comment
Question by:BlueEdger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
EBatista earned 375 total points
ID: 10841286
try comparing the GetRedirectUrl property with String.Empty:

If Not FormsAuthentication.GetRedirectUrl = String.Empty Then
   Server.Transfer ("/SubFolder/Default.aspx" )
End If

or

If FormsAuthentication.GetRedirectUrl = String.Empty Or FormsAuthentication.GetRedirectUrl = "Default.aspx" Then
         Server.Transfer ("/SubFolder/Default.aspx" )        
        Else
         FormsAuthentication.RedirectFromLoginPage (UserName.Value, True)
End If

regards
0
 
LVL 1

Author Comment

by:BlueEdger
ID: 11096020
Sorry, have been meaning to close my open questions for some time.

In the end, due to project time constraints, I gave up using forms authentication in the end, and just did the authentication myself - much easier!  So thanks Microsoft but as usual you've only come up with a half baked solution that doesnt work in the real world!

I must admit that I have not tested EBatista's solution (sorry I do appreciate your help), but am happy to award you the points.

Apologies for my lack of attentiveness.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question