protected HttpSessionState Session; //--- The page session object
protected HttpResponse Response;
public void SessionCheck(Object parent)
{
try
{
Session=((System.Web.UI.Page)parent).Session;
Response=((System.Web.UI.Page)parent).Response;
}
catch
{
Session=((System.Web.UI.UserControl)parent).Session;
Response=((System.Web.UI.UserControl)parent).Response;
}
string checkSession ="";
try
{
if (this.sessionidentifier == "0")
{
checkSession = Session["AdminID"].ToString();
}
else
{
checkSession = Session["UserID"].ToString();
}
}
catch
{
if (this.sessionidentifier == "0")
{
Response.Redirect("Adminlogin.aspx");
}
else
{
Response.Redirect("Login.aspx");
}
}
if(checkSession == null || checkSession.Length == 0 || checkSession == "")
{
if (this.sessionidentifier == "0")
{
Response.Redirect("Adminlogin.aspx");
}
else
{
Response.Redirect("Login.aspx");
}
}
}