Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I m using this code to restrict the url access;

XML
<authentication mode="Forms">
    <forms name="Authen" protection="All" timeout="60" loginUrl="Login.aspx"/>
</authentication>

<authorization>
    <deny users="?"/>
</authorization>



But i m not able to get the master page design. design format totally changed if i use this code.
Posted
Comments
Ankur\m/ 16-Apr-13 1:17am    
Any page in the website will redirect you to Login.aspx page unless you are authenticated. Make sure you login page uses the Master page and you will be able to maintain the same look and feel there as well.
Dhritirao's 16-Apr-13 1:22am    
i m having three differnt masterpages 1 for login page another one for only user is manager and last for employees

You should make your folder where the contet files (.css, images, etc) accesible to all users by adding configurations like in the next example.

XML
<location path="Content">
       <system.web>
         <authorization>
           <allow users="*" />
         </authorization>
       </system.web>
   </location>
 
Share this answer
 
i got the solution i maintained a session to store the role and if the role what i mentioned is not there means we cant open thru the url

C#
if ((Session["Email"] == null || Session["Email"].ToString() == "") && (Session["Role"].ToString() != ResourceManagementConstants.str_Resource))
      {
          Response.Redirect("../Login.aspx");
      }
 
Share this answer
 

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