Sivakumar

Sivakumar

  • NA
  • 551
  • 217.8k

How to check is admin or not after login

Mar 24 2016 2:53 AM
Hi ,
 
I want to check condition after login is admin or not
 
This is my code :
 
 
 
data is coming like above image  
 
protected void txtLogin_Click(object sender, EventArgs e)
{
LoginModel login = new LoginModel();
login.UserName = txtUserName.Text;
login.Password = txtPassword.Text;
var result =_loginBL.UserLogin(login);
txtUserName.Text = "";
txtPassword.Text = "";
if (result !=null)
{
Session["userName"] = login.UserName;
//string type = ballogin.usertype(login);
//Session["usertype"] = type;
Response.Redirect("home.aspx");
}
//else if (a == 2)
//{
// Session["userName"] = userName;
// Response.Redirect("adminHome.aspx");
//}
else
{
error.Text = "Enter the valid details";
}
 
Please help me 

Answers (8)