本文整理汇总了VB.NET中System.Web.UI.Control.SaveViewState方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Control.SaveViewState方法的具体用法?VB.NET Control.SaveViewState怎么用?VB.NET Control.SaveViewState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.Control
的用法示例。
在下文中一共展示了Control.SaveViewState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: SaveViewState
Protected Overrides Function SaveViewState() As Object
' Change Text Property of Label when this function is invoked.
If HasControls() And Page.IsPostBack Then
CType(Controls(0), Label).Text = "Custom Control Has Saved State"
End If
' Save State as a cumulative array of objects.
Dim baseState As Object = MyBase.SaveViewState()
Dim _userText As String = UserText
Dim _passwordText As String = PasswordText
Dim allStates(3) As Object
allStates(0) = baseState
allStates(1) = _userText
allStates(2) = PasswordText
Return allStates
End Function