_____________关于全局变量的数组和结构体,谢谢
我在Page_Load之前定义了个全局变量,但是在Page_Load再次发生时,就会又被初始化成定义时的值,于是对于单个变量我采用这个方法:
Public Property type() As String
Get
Dim o As Object = ViewState("type")
If o Is Nothing Then
Return String.Empty
End If
Return DirectCast(o, String)
End Get
Set(ByVal Value As String)
ViewState("type") = Value
End Set
End Property
可是对于数组和结构体之类的全局变量, 我该如何才能实现在Page_Load再次发生时,还是保持原来的值?
谢谢前辈们指点