hi all,
i am facing "object reference not set to the instance of an object" error in the following code.
protected void Page_Load(object sender, EventArgs e)
{
roleID =
Convert.ToInt32(Session["roleId"]);
if (Request.QueryString["EmployeeID"] != null)
{
empId = Request.QueryString[
"EmployeeID"];
}
else
{
empId = (
string)Session["LoginId"];
}
if (!IsPostBack)
{
try
{
RetrieveEmpInfo();
Session[
"ViewEmpid"] = null;
if (roleID == 1 || roleID == 2 || roleID == 3)
{
pnlApprovals.Visible =
true;
pnlLeave.Visible =
true;
}
else
{
pnlApprovals.Visible =
false;
pnlLeave.Visible =
false;
}
GetEmployeeLeaveApprovalsandSubmissions();
GetPendingApplyLeavses();
}
catch (Exception ex)
{
if (log.IsErrorEnabled)
{
log.Error(ex.Message);
}
}
}
}
please check and let me the issues when it happen.