how to set StartupPage of Default.aspx Using master Page
but have maintain session by login page which WebForm
Defalt.aspx Page is contentPage
When non registerd users are visit at site then only show some conteintes and if login Registerd user then will access to product Page and other respective contents
Site1.master.cs
protected void Page_Load(object sender, EventArgs e)
{
_CustomerID = Convert.ToInt32(Session["CustomerID"]);
RoleId = Convert.ToInt32(Session["txtUserType"]);
Lbl_CartTotalAmt.Text = "0";
cartcount(_CustomerID);
_getPrice(_CustomerID);
if (!this.IsPostBack)
{
// Lbl_UserID.Text = Session["CustomerID"].ToString();
_CustomerID = Convert.ToInt32(Session["CustomerID"]);
AddToDataList();
cartcount(_CustomerID);
_getPrice(_CustomerID);
// SessionByUserType();
if (Session["CustomerID"] != null || Session["user"] == null || Session["txtUserType"] != null)
{
Lbl_UserID.Text = Session["CustomerID"].ToString();
lbl_UserType.Text = Session["txtUserType"].ToString();
lblLoggedUser.Text = Session["user"].ToString();
// Response.Redirect("~/Login");
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Session timeout ...')", true);
Response.Redirect("~/Login");
}
}
if (Request.Url.ToString().Contains("/Home") || Request.Url.ToString().Contains("/Login"))
{
if (Session["CustomerID"] != null || Session["User"] != null)
{
lblLoggedUser.Text = Session["User"].ToString();
lbl_UserType.Text = Session["txtUserType"].ToString();
Lbl_UserID.Text = Session["CustomerID"].ToString();
Response.ClearHeaders();
Response.AddHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
Response.AddHeader("Pragma", "no-cache");
LougoutLink.Visible = true;
lblLoggedUser.Visible = true;
his.Visible = true;
}
LinkLogin.Visible = false;
UpdatePanel1.Update();
}
else
{
if (Session["CustomerID"] != null || Session["User"] != null)
{
lblLoggedUser.Text = Session["User"].ToString();
lbl_UserType.Text = Session["txtUserType"].ToString();
Lbl_UserID.Text = Session["CustomerID"].ToString();
Response.ClearHeaders();
Response.AddHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate");
Response.AddHeader("Pragma", "no-cache");
// ltHi.Visible = true;
LougoutLink.Visible = true;
lbtoredrhistory.Visible = true;
// LinkLogin.Visible = false;
UpdatePanel1.Update();
}
}
}
default.cs
protected void Page_Load(object sender, EventArgs e)
{
}