protected void Page_Load(object sender, EventArgs e) { if (Session["USER"] != null && UserDBHelper.IsUserAdmin(Session["USER"].ToString())) { litTalk.Text = "Welcome " + Session["USER"]; } }
protected void Page_Load(object sender, EventArgs e) { this.Form.DefaultButton = this.btnExamID.UniqueID; if (Session["USER"] != null && !UserDBHelper.IsUserAdmin(Session["USER"].ToString())) { litTalk.Text = "Welcome " + Session["USER"]; } }
protected void btnSignIn_Click(object sender, EventArgs e) { int?userId = UserDBHelper.IsCredentialsValid(txtUserName.Text, txtPassword.Text); if (userId != null) { Session["USER"] = txtUserName.Text; Session["USERID"] = userId; if (UserDBHelper.IsUserAdmin(Session["USER"].ToString())) { Session["ISADMIN"] = "1"; Response.Redirect("AdminHome.aspx"); } Response.Redirect("Home.aspx"); } }