How to keep RETURNURL when accessing a secure page, yet disable it when logging in explicitly ?

April 29, 2008 at 9:34 pm | In ASP.NET Tips | Leave a Comment

I have a loginstatus control on my masterpage so that a user would have the ability to login no matter what page of the website he is on.  When he clicks on that, it brings him to the login page with the login control.  I explicitly hardcoded a specific page for the destinationpageurl attribute of the login control, but it seems the returnurl overrides that setting.  It seems the returnurl is set for the page I was previously on.  Why is the returnurl being set if I wanted to just login explicitly?  How would the hardcoded destinationpageurl ever get a chance to work then?

However, the returnurl is very useful to me in other situations.  For example, say an unauthenticated user is browsing the site and he clicks on a button (or link or whatever) that leads to a secure page (all of my secure pages are under a folder allowing only authenticated users to view them).  The site directs him automatically to the login page with the returnurl instructing the site to forward him to the intended destination after successful login.  This is desirable.  However, as stated earlier, when a user explicitly clicks on the loginstatus to log in, I want him to be directly led to a specfic page (like myaccount.aspx or something).

How do I do this?

Thanks in advance.

Read More

No Comments Yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.