How to make ASP.NET authentication persist the Url Fragment when redirecting to the login page?
- by estourodepilha.com
After I inserted the configuration below in my Web.Config
<authentication mode="Forms">
<forms name="appNameAuth"
path="/" loginUrl="login.aspx" protection="All" timeout="30">
<credentials passwordFormat="Clear">
<user name="user" password="password" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
All requests to
Menu.aspx#fragment
are redirected to
login.aspx?ReturnUrl=/Menu.aspx
and I expected it to be redirected to
login.aspx?ReturnUrl=/Menu.aspx#fragment
How to achieve the desired behavior?