Faced issue while switching to any page after login successfully everytime. It requires login credential everytime whereas i maintained session state properly.
Worked Perfectly on Development server whereas on Production issue occur. Please suggest
Login Page -
protected void btnLogin_Click(object sender, EventArgs e)
{
String strCheckStatus = String.Empty;
g_strContact = txtPhone.Text;
String strLoginPassword = txtPassword.Text;
List parameters = new List
{
new SqlParameter("@P_MOBILE_NO", g_strContact),
new SqlParameter("@P_PASSWORD", strLoginPassword),
};
strCheckStatus = ExecuteQueryStoredProcedure(strUSP_SEC_LOGIN_PROCESS, parameters);
if (strCheckStatus == "0")
{
//login successfull
Session["Name"] = g_strName;
Session["MobileNumber"] = g_strContact;
Session["SlabType"] = g_strSlabType;
Session["UserType"] = g_strUserType;
Session["AssociateMobileNo"] = g_strContact;
if (g_strUserType == "Admin")
{
FormsAuthentication.RedirectFromLoginPage(Session["MobileNumber"].ToString(), false);
}
}
Session maintain in every page in Page Load event-
protected void Page_Load(object sender, EventArgs e)
{
if (Session["MobileNumber"] != null)
{
lblMobile.Text = Session["MobileNumber"].ToString();
}
else
{
var returnUrl = Server.UrlEncode(Request.Url.PathAndQuery);
Response.Redirect("~/Login.aspx?ReturnURL=" + returnUrl);
}
if (!this.IsPostBack)
{
PopulateGrid();
PopulateData();
}
}

Ruchi SharavatPosted Aug 1, 2018, 2:23 AM
Himanshu TyagiPosted Aug 1, 2018, 2:15 AM
Jefferson S. MottaPosted Jul 31, 2018, 11:43 AM
Himanshu TyagiPosted Jul 31, 2018, 4:26 AM
Ruchi SharavatPosted Jul 31, 2018, 12:26 AM
Himanshu TyagiPosted Jul 30, 2018, 6:27 AM
Ruchi SharavatPosted Jul 30, 2018, 5:11 AM
Himanshu TyagiPosted Jul 30, 2018, 2:51 AM
Himanshu TyagiPosted Jul 30, 2018, 2:51 AM
Jaish MathewsPosted Jul 30, 2018, 2:44 AM
Ruchi SharavatPosted Jul 30, 2018, 2:41 AM
D DonthuPosted Jul 30, 2018, 2:41 AM