Solved

Forms Authentication - RedirectFromLoginPage Is Null

Posted on 2004-04-16
3
367 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 125 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 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