Partial Class ClientCenter_UpdateSub
Inherits System.Web.UI.Page
Structure PInfo
Dim Name As String
Dim Surname As String
End Structure
Dim OldPInfo As New PInfo
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
'blah blah
OldPInfo.Name = Dt.Rows(0).Item("Name").ToString
OldPInfo.Surname = Dt.Rows(0).Item("Surname").ToString
end if
end sub
End Class
第一次加载页面时,我的结构已正确填充。在 AJAX 回发之后,所有结构字段都设置为空。(似乎Dim OldPInfo As New PInfo
又被调用了),但我最好问问 SO 专家。
所以无论如何,我在这里做错了什么?