本文整理汇总了VB.NET中System.Web.UI.UserControl.Session属性的典型用法代码示例。如果您正苦于以下问题:VB.NET UserControl.Session属性的具体用法?VB.NET UserControl.Session怎么用?VB.NET UserControl.Session使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Web.UI.UserControl
的用法示例。
在下文中一共展示了UserControl.Session属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: SubmitBtn_Click
' Saves state information which is used by display handler after the postback has occurred.
Sub SubmitBtn_Click(Sender As Object, e As EventArgs)
' Clear all values from session state of 'Page'.
Session.Clear()
' Populate Session State of UserControl with the values entered by user.
myControl.Session.Add("username",myControl.user.Text)
myControl.Session.Add("password",myControl.password.Text)
' Add UserControl state to the SessionState object of Page.
Session(myControl.user.Text)= myControl
Display.Enabled = true
End Sub
Sub Display_Click(Sender As Object,e As EventArgs)
Dim position As Integer = Session.Count - 1
' Extract stored UserControl from the session state of page.
Dim tempControl As LogOnControl = CType(Session(Session.Keys(position)),LogOnControl)
' Use SessionState of UserControl to display previously typed information.
txtSession.Text = "<br /><br />User:" + tempControl.Session("username") + "<br />Password : " + tempControl.Session("password")
Display.Enabled = false
End Sub