-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadminmaster.master.cs
47 lines (43 loc) · 1.65 KB
/
adminmaster.master.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class admin_adminmaster : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
//Response.Cache.SetCacheability(HttpCacheability.NoCache);
//Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
//Response.Cache.SetNoStore();
if (Session["master"] != null && (Session["role"].ToString() == "admin"))
{
lblsess.Text = Session["role"].ToString();
lblsessmas.Text = Session["master"].ToString();
MultiView1.ActiveViewIndex = 0;
}
else if (Session["master"] != null && (Session["role"].ToString() == "accountant"))
{
lblsess.Text = Session["role"].ToString();
Lblsessmas2.Text = Session["master"].ToString();
MultiView1.ActiveViewIndex = 1;
}
else if (Session["master"] != null && (Session["role"].ToString() == "teacher"))
{
lblsess.Text = Session["role"].ToString();
lblsessmas3.Text = Session["master"].ToString();
MultiView1.ActiveViewIndex = 2;
}
else
{
Response.Write("<script>alert('Please Log In'); window.location.href = 'Signin.aspx'</script>");
}
}
protected void lnkSignout_Click(object sender, EventArgs e)
{
Session.Abandon();
Session.Clear();
Response.Write("<script>alert('Signed Out!! '); window.location.href = 'Signin.aspx'</script>");
}
}