forked from robi-y/seproject-team-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSite1.Master.cs
More file actions
executable file
·66 lines (52 loc) · 1.76 KB
/
Copy pathSite1.Master.cs
File metadata and controls
executable file
·66 lines (52 loc) · 1.76 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace JumpUp
{
public partial class Site1 : System.Web.UI.MasterPage
{
//string buttonText;
//public string ButtonText
//{
// get { return Button1.Text; }
// set { Button1.Text = value; }
//}
//public string ButtonText
//{
// get { return ((Button)Page.FindControl("Button1")).Text; }
// set { ((Button)Page.FindControl("Button1")).Text = value; }
//}
protected void Page_Load(object sender, EventArgs e)
{
string s = this.Page.Request.FilePath;
//TODO: add list of all pages need to be "Log Out"
if (s.Equals("/individual.aspx") || s.Equals("/ChooseLesson.aspx")|| s.Equals("/Add.aspx"))
Button1.Text = "LogOut";
else
Button1.Text = "LogIn";
//if ((string)Session["userName"] != null)
// Button1.Text = "LogOut";
//else
// Button1.Text = "LogIn";
// buttonText = ((Button)Page.FindControl("Button1")).Text;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Button1.Text.Equals("LogOut"))
{
Button1.Text = "LogIn";
Session["userName"] = null;
Session.Abandon();
Response.Redirect("Home.aspx");
}
else
Response.Redirect("Login.aspx");
}
}
}