Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 1st, 2006, 06:32 PM
Registered User
Join Date: Sep 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Login logic problem

I've noticed a problem with the login logic in the beerhouse example. Forgive me if this has already been covered, but I couldn't find it in this forum anywhere. Here's the problem:

If I come in unauthenticated and try to go to the admin page, I get the AccessDenied.aspx page with ReturnUrl="[path]/Admin/Default.aspx" (or whatever the encoded version of that is).

Ok, so far so good here. However, if I then try to log in with the wrong credentials, I am again returned to the AccessDenied.aspx page, only this time ReturnUrl="[path]/AccessDenied.aspx?ReturnUrl=[path]/Admin/Default.aspx". So, the problem now is that if I go ahead and enter the right credentials, I get returned to the AccessDenied page again, but now I'm authenticated, so it just tells me that I'm not authorized for the page.

I think the solution to this is to change the FailureAction attribute of the Login control to "Refresh" since you want it to stay on the same page and not redirect to AccessDenied since you may already be there. However, doing this will mean you'll never see the AccessDenied page for an invalid login, which means you'll need to use the Access Denied message built into the login control itself. Either that or figure out some way to switch the FailureAction from Refresh to RedirectToLoginPage if you're not on the AccessDenied page already.

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
Looping through a list using logic tags problem aadz5 Struts 3 September 23rd, 2011 03:18 AM
Problems with login logic and Dashboard alanphil BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 18 August 13th, 2009 05:04 AM
problem while using <logic:iterate> tag be_sandip BOOK: Professional Jakarta Struts 0 November 13th, 2006 08:05 AM
Problem with loop logic holdmykidney XSLT 5 July 16th, 2004 07:11 AM
Mixing Data access logic and business logic polrtex BOOK: Professional Jakarta Struts 0 December 15th, 2003 07:19 PM

All times are GMT -4. The time now is 05:24 AM.

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