-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeader.aspx.vb
More file actions
73 lines (51 loc) · 2.16 KB
/
Header.aspx.vb
File metadata and controls
73 lines (51 loc) · 2.16 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
67
68
69
70
71
72
73
Partial Class header2
Inherits System.Web.UI.Page
#Region " Page "
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
If Not Page.IsPostBack Then
Dim STR As String = " "
If Not Session("UserId") Is Nothing Then
STR &= " " & Session("UserId").ToString
End If
lUser.Text = STR.ToString
lroles.Text = Session("namaroles")
End If
Catch ex As Exception
Response.Write("Page_Load Exception :<br>" & ex.ToString)
End Try
End Sub
#End Region
Protected Sub btlogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btlogout.Click
Try
Response.Cookies.Remove(FormsAuthentication.FormsCookieName)
If Not Request.Cookies Is Nothing Then
Response.Cookies.Remove("userCookie")
End If
FormsAuthentication.SignOut()
Session.Clear()
Session.Abandon()
Response.Write("<script language=javascript>parent.location.href = 'index.aspx';</script>")
Catch ex As Exception
Response.Write("btLogOut Exception :<br>" & ex.ToString)
End Try
End Sub
Protected Sub btnhome_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnhome.Click
Response.Write("<script language=javascript>parent.location.href = 'MainMenu.aspx';</script>")
End Sub
Protected Sub btnswitch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnswitch.Click
Try
Response.Cookies.Remove(FormsAuthentication.FormsCookieName)
If Not Request.Cookies Is Nothing Then
Response.Cookies.Remove("userCookie")
End If
FormsAuthentication.SignOut()
Session.Clear()
Session.Abandon()
Response.Write("<script language=javascript>parent.location.href = 'index.aspx';</script>")
Catch ex As Exception
Response.Write("btLogOut Exception :<br>" & ex.ToString)
End Try
End Sub
End Class