Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 19th, 2004, 01:15 PM
Authorized User
 
Join Date: Jun 2004
Location: , , USA.
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default FormsAuthentication.RedirectFromLoginPage

Hi there:
I have tried all I could to figure out why my
FormsAuthentication.RedirectFromLoginPage(customer Id, RememberMe.Checked)
invariably redirects to the default.aspx regardless of the return page that I see in the URL.
For instance, when I login after coming in from the shopping cart page(when I click checkout in the shopping cart page which is supposed to take me to the checkout page), it rightly takes me to the login page. But when I login I am redirected to the default.aspx instead of being taken to the checkout page.
Any suggestions will be extremely helpful. Thanks.
Reply With Quote
  #2 (permalink)  
Old August 19th, 2004, 02:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Are you sure that the return page as specified in the return url:

http://...?ReturnUrl=somepage.aspx

actually exists and your user has access to it? If not, RedirectFromLoginPage by default will send you to default.aspx.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
Reply With Quote
  #3 (permalink)  
Old August 19th, 2004, 02:59 PM
Authorized User
 
Join Date: Jun 2004
Location: , , USA.
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes Jeff, thats what shows in the URL
http://...login.aspx?returnPage=Checkout.aspx
 & it does exit and is accessible - I can access it after I login. However, it does not take me to the return page for what ever reason, immediately after I login like it should.
So, from what you say, it looks like for some reaseon FormsAuthentication.Redirect method is simply not reading the ReturnURL.
Shailesh Mark.

Reply With Quote
  #4 (permalink)  
Old August 19th, 2004, 05:02 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

It's interesting that you say that the return URL is:

http://...login.aspx?returnPage=Checkout.aspx

Forms based authentication in .NET uses the query string:

 ... ?ReturnUrl=<somepage.aspx>

i.e. ?returnUrl not ?returnPage ...

Perhaps this was just a typo. Are you sure you are really using forms based authentication and you have the necessary settings for form-based authentication set in web.config?

I've used it on several occasions and have not seen your symptoms - it works fine - for me, anyway.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com
Reply With Quote
  #5 (permalink)  
Old August 19th, 2004, 05:15 PM
Authorized User
 
Join Date: Jun 2004
Location: , , USA.
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

figured it out fellows. Just in my enthusiasm to reinforce my url authorization configured in the web.config file, I also added a few unnecessary lines of code in my codebehind that would still check for user.identity.name, and if null, then redirect to login. they would be redirected to login in any case because of url authorization configuration in my web.config. So I removed the code from code behind and it is working now. Thanks. Shailesh.

Reply With Quote
  #6 (permalink)  
Old August 19th, 2004, 05:17 PM
Authorized User
 
Join Date: Jun 2004
Location: , , USA.
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey jeff, saw your post after i posted the last one -- yes your were right -- there really weren't any typos to be exact. please see my last post. thanks.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FormsAuthentication swifty_programmer ASP.NET 2.0 Basics 0 August 24th, 2007 05:53 AM
FormsAuthentication whfang ASP.NET 1.x and 2.0 Application Design 1 January 16th, 2007 05:42 PM
FormsAuthentication Class g2000 ASP.NET 2.0 Basics 2 November 24th, 2005 01:43 AM
FormsAuthentication not declared! Renu ASP.NET 1.0 and 1.1 Basics 2 October 6th, 2004 10:29 AM
FormsAuthentication Class alyeng2000 ASP.NET 1.0 and 1.1 Basics 7 March 3rd, 2004 02:19 AM



All times are GMT -4. The time now is 04:29 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.