So here is the problem.
I use Anchors as a non-refreshing way to allow bookmarking of currently view objects.
http://myserver/showobject.aspx#objectid=10
I use this so when updating the object id it doesn't try to do a refresh on the page.
Heres the rub.
I am using forms Authentication to handle access to these pages. So When you try to browse to the above link without having logged in first, it redirects you to the login page. Once you have been successfully authenticated it FormsAuthentication.RedirectFromLoginPage(...) you to the page you came from.
Except that it trunks the #objectid=10 bit off.
I have thought up a few hacks (set a cookie before the redirect to the login page and then read the cookie and update the link after the "RedirectFromLoginPage" is done) for getting around this, but was wondering if there was any real way to make FormsAuthentication.RedirectFromLoginPage do what i actually want it to do.
So recap:
Trying to goto http://myserver/showobject.aspx#objectId=10
Redirected to login
Current/Wrong Behavior: redirected after login to http://myserver/showobject.aspx - sans #objectId=10
Future/Right Behavior: redirected after login to complete original url, http://myserver/showobject.aspx#objectId=10
Thanks for the assist in advance,
John.
temporary cookie is the way to go here. web browsers don't send anything after the "#" when telling the server which URL they are being referred from - so the server can't capture that info and know to use it after the user signs in
That part of the URL is called a fragment and doesn't get seen by the server side. There are hacky ways around it using an interstitial page and a bit of javascript, but it can get messy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With