i am using login from this link Simple User Login Form example in ASP.Net
Login by Civilid and Password
i have 2 page users.aspx and admin.aspx
i can use the column adding Admin and user to call the page ?
so if the user login and he/she got user open page user
protected void ValidateUser(object sender, AuthenticateEventArgs e)
{
int Id = 0;
string constr = ConfigurationManager.ConnectionStrings["kankonConnectionString"].ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("Validate_User"))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@civilid", Login1.UserName);
cmd.Parameters.AddWithValue("@Password", Login1.Password);
cmd.Connection = con;
con.Open();
readdataname();
Id = Convert.ToInt32(cmd.ExecuteScalar());
con.Close();
}
switch (Id)
{
case -1:
Login1.FailureText = "تأكد من الرقم المدني او كلمة المرور";
break;
case -2:
Login1.FailureText = "Account has not been activated.";
break;
default:
FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);
break;
}
}
}