Click here to Skip to main content
15,923,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My webite have menu Home,Login/Register,Services
I want if user is not logged in and clicks on services tab, dialog box should appear saying you have to login.

How to do this?
Posted
Updated 24-Mar-11 20:21pm
v2
Comments
Prerak Patel 25-Mar-11 2:22am    
Don't use text speech.

Use Forms Authentication.

Use some thing like this at web.config

XML
<location path="secure">
    <system.web>
      <authorization>
        <deny users="?"/>
        <deny users="jhon"/>
      </authorization>
    </system.web>
  </location>


secure is a folder which contains your secure webforms.

XML
<authentication mode="Forms">
      <forms loginUrl="Default.aspx"
           protection="All"
           timeout="30"
           name=".ASPXAUTH"
           path="/"
           requireSSL="false"
           slidingExpiration="true"
           defaultUrl="default.aspx"
           cookieless="UseDeviceProfile"
           enableCrossAppRedirects="false" >
        <credentials passwordFormat="Clear">
          <user name="kim" password="kim@123"/>
          <user name="jhon" password="jhonn"/>
        </credentials>
      </forms>
    </authentication>
 
Share this answer
 
Comments
Bhavna v 25-Mar-11 6:39am    
Good say
 
Share this answer
 
Use sessions concept. It will be helpful to You as per my knowledge..
 
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