Dear Sir,
How to pass multiple value from lgn.aspx Page to Index.aspx in asp c#
I want to send multiple value from one page to another page.
I am able to sent EmpCode value from lgn.aspx to Index.aspx but I unable to send EmpName values.
please help me sir.
namespace OCMS
{
public partial class lgn : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int companyId;
string constr = ConfigurationManager.ConnectionStrings["constr"].ToString();
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand("SELECT * FROM tbl_Employees WHERE EmpCode=@EmpCode AND UserName=@UserName", con))
{
DataTable dt = new DataTable();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
cmd.Parameters.AddWithValue("@EmpCode", txtUserName.Text);
cmd.Parameters.AddWithValue("@UserName", txtPassword.Text);
sda.Fill(dt);
if (dt.Rows.Count > 0)
{
companyId = int.Parse(dt.Rows[0]["CompanyId"].ToString());
switch (companyId)
{
case 1003:
string EmpId = txtUserName.Text;
Response.Redirect(string.Format("~/Index.aspx?EmpId={0}", EmpId));
break;
case 1002:
Response.Redirect("It_admin.aspx");
break;
}
}
}
}
}
}
}