using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration; using nmsSetup; using KMASchoolERP; public partial class UserPanel_UserControl : System.Web.UI.UserControl { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //ViewStudentDetail(); } } // ------------------Student Detail-----------------------// protected void lnklogout_Click(object sender, EventArgs e) { if (Session["officeWebUser"] != null) { //if (Session["WebSess"] != null) //{ // Session.Abandon(); // Session.Clear(); // Request.Cookies.Clear(); // HttpContext.Current.Response.AddHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HttpContext.Current.Response.AddHeader("Pragma", "no-cache"); // HttpContext.Current.Response.AddHeader("Expires", "0"); // Response.Redirect("../../Default.aspx"); //} Session.Abandon(); Session.Clear(); Request.Cookies.Clear(); HttpContext.Current.Response.AddHeader("Cache-Control", "no-cache, no-store, must-revalidate"); HttpContext.Current.Response.AddHeader("Pragma", "no-cache"); HttpContext.Current.Response.AddHeader("Expires", "0"); Response.Redirect("~/LoginStu.aspx?user=Logout"); } } }