my project has been already running but ringht now i have getting mention error. please help to remove this.
Server Error in '/sfty_Lead_lag' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0103: The name 'department' does not exist in the current context Source Error:
|
Line 54: txtEMPNO.Text = "" + EMPNO + "";
Line 55: txtNAME.Text = "" + EmpName + "";
Line 56: txtDEPARTMENT.Text = "" + department + "";
Line 57: }
Line 58:
|
Source File: f:\Intranet\mejaitapps\sfty_Lead_lag\WebForm2.aspx.cs Line: 56
Show Detailed Compiler Output:
Show Complete Compilation Source:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3062.0
protected void Page_Load(object sender, EventArgs e)
{
if (Session["EmpName"] == null)
{
Response.Redirect("login.aspx");
}
else
{
String EmplooyeId = Convert.ToString((int)Session["EMPNO"]);
String EMPNO = Session["EMPNO"].ToString();
String EmpName = Session["EmpName"].ToString();
String department = Session["department"].ToString();
txtEMPNO.Text = "" + EMPNO + "";
txtNAME.Text = "" + EmpName + "";
txtDEPARTMENT.Text = "" + department + "";
}
if (!Page.IsPostBack)
{
this.BindGrid();
int currentYear = DateTime.Today.Year;
ddl_Year.Items.Clear();
// ddl_Year.Items.Add("Select");
for (int i = 1; i >= 0; i--)
{
int fy = currentYear - i;
int fy1 = fy + 1;
if (DateTime.Now.Date > Convert.ToDateTime(fy + "-03-31").Date)
{
ddl_Year.Items.Add(fy.ToString() + "-" + fy1.ToString());
}
}
txtDATE.Text = DateTime.Now.ToString();
DateTime currentDate = DateTime.Now;
List<ListItem> items = new List<ListItem>();
items.Add(new ListItem
{
Text = currentDate.AddMonths(-1).Month.ToString(),
Value = currentDate.AddMonths(-1).Month.ToString()
});
items.Add(new ListItem
{
Text = currentDate.Month.ToString(),
Value = currentDate.Month.ToString()
});
ddl_Month.DataSource = items;
ddl_Month.DataTextField = "Text";
ddl_Month.DataValueField = "Text";
ddl_Month.DataBind();
}
if (!IsPostBack)
{
string query = "select CountryId, CountryName from Countries";
BindDropDownList(DropDownList2, query, "CountryName", "CountryId", "Select ");
DropDownList3.Enabled = false;
DropDownList3.Items.Insert(0, new ListItem("Select ", "0"));
}
}