Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to use form authentication in asp.net.
Posted

 
Share this answer
 
v2
Here is a list of some Code Project Articles on this topic.

http://www.codeproject.com/search.aspx?q=form+authentication+in+asp.net&sbo=kw
 
Share this answer
 
use login control over your page and add in web.cofig file <deny users="?"/>
this how u'll use form authentication
 
Share this answer
 
ADD AUTHENTICATION TAG IN UR WEB.CONFIG FILE AND PASS THE DEFAULT FORM NAME
 
Share this answer
 
You Can Create session, and take ths value on every page and define the roleId, If a user have authentication then he can open tha page, other wise he cannot ope the page, ther is some code with the help of this code you can solve your problem.
string strCurrentRole;
        try
        {
            strCurrentRole = Request.QueryString["RoleId"].ToString();
            if (Session["Admin"] == null || strCurrentRole != "04" || Session["Roles"].ToString().IndexOf("04") == -1)
            {
                Session.RemoveAll();
                Response.Redirect("Default.aspx");
            }
        }
        catch
        {
            Session.RemoveAll();
            Response.Redirect("Default.aspx");
        }

There is role id whic you can define on your page.
 
Share this answer
 
v2

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