Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi every one

I have a web application.
I used Forms authentication and set Login.aspx as the Login url.
So when I try to enter any other page url in my address bar Iam redirected to Login page as per its setting.

But now I need to give a link called Register in Login.aspx page.
Clicking on Register link should take me to Register.aspx page.
But as per authentication settings I am redirected to Login page.

So is there a way to omit or escape the register.aspx page from this authentication setting?

Thanks in advance.
Posted
Updated 8-Dec-10 22:49pm
v4
Comments
Dalek Dave 9-Dec-10 4:49am    
Edited for Readability.

Add following in your web.config

<location allowOverride="true" path="Register.aspx">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>


Accept answer if it is correct
 
Share this answer
 
v2
Comments
Dalek Dave 9-Dec-10 4:50am    
Good Answer.
It seems you are playing with the SQL Authentication for the first time ;) .
SQL Authentication is my favorite. It reduces lot of your code work regarding authentication and authorization.

The solution to your problem is providing explicit access to the webpage you want to show without authentication. Just add below lines in your Web.Config and you are ready to go:

Under the <configuration> tag enter below lines-
XML
<location path="File Path">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
 
Share this answer
 
v2
Comments
Dalek Dave 9-Dec-10 4:50am    
Good Call.

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



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