HI
I have House_info Table in database
Id
|
Name
|
Behcode
|
Password
|
T_name
|
1
|
Sara
|
1111
|
1212
|
Store
|
2
|
Jack
|
2222
|
4545
|
Estate
|
and I have Admin.aspx page
in this page I have EnterBTN Button and 2 Textbox TxtBeh and TxtPass here users enter Behcode and Password and when they click on EnterBTN Button it go to other page
below is EnterBTN Event code
protected void EnterBTN_Click(object sender, ImageClickEventArgs e)
{
string data = Server.UrlEncode(Txtbeh.Text);
SqlCommand _cmd = new SqlCommand("EnterStore", _cn);
_cmd.CommandType = CommandType.StoredProcedure;
_cn.Open();
_cmd.Parameters.AddWithValue("@Behcode", Txtbeh.Text);
_cmd.Parameters.AddWithValue("@PassWord", Txtpass.Text);
bool isValid = aspcap.Validate(Txtc.Text.Trim());
if (isValid)
{
int count = Convert.ToInt32(_cmd.ExecuteScalar());
if (count > 0)
{
Session["Login"] = true;
Session["BehCode"] = Server.UrlEncode(Txtbeh.Text);
Response.Redirect("Managers.aspx?BehCode=" + Server.UrlEncode(Txtbeh.Text));
}
else
{
Session["Login"] = null;
Session["MessageError"] = true;
lblcap.Visible = false;
}
}
else
{
lblcap.Visible = true;
}
_cn.Close();
Alert();
}
here if users enter correct Behcode and password it go to Manager.aspx page
I want if users enter correct behcode and password if their T_name was =Store it go to Manager.aspx page And if their T_name was Estate it go to Estate.aspx page
How I can do it ?
BestRegards