Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
I am using formsauthentication in Visual Studio 2019. Since I am using friendly urls, I have below shown code for forms authentication.

XML
<system.web>
    <authentication mode="Forms">
        <forms name=".ASPXAUTH" loginUrl="Login" defaultUrl="Home" slidingExpiration="true" 
        timeout="60"></forms>
    </authentication>
    <authorization>
      <deny users="?"/>
    </authorization>
</system.web>


Configuration in web.config upto above works fine. I now want to add User register page that will not require user to be authenticated. I added following code for this:

XML
<configuration>
    <location path="Register">
        <system.web>
        
    <authorization>
                <allow users="*"/>
            </authorization> 
        </system.web>
    </location>


I donot know why I am not able to access register page without login in page. I tried using register.aspx but still not able to login. I can this url in: https://localhost:44327/Login?ReturnUrl=%2fRegister

In older visual studio, it used to work. I have allowed all users to access the page but still register page is not opened without login. How can anonymous user access register page?

What I have tried:

I changed to
<location path="Register.aspx">
. set deny anonymous users in
<authorization>
Posted
Updated 12-Apr-21 4:26am
v2
Comments
Member 12246365 13-Mar-22 12:40pm    
Code DeCodes - did you ever determine what the issue was?

1 solution

Code DeCodes - did you ever determine what the issue was?
 
Share this answer
 
Comments
Richard Deeming 14-Mar-22 5:16am    
Do not post a question as a "solution". You have already posted this as a comment, so delete this non-solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900