{0}:TBPanel>")> Public Class TBPanel Inherits System.Web.UI.WebControls.Panel Private FMaintainScrollPositionOnPostBack As Boolean = False
''' ''' 在 PostBack 时自动维护滚动条位置。 ''' Public Property MaintainScrollPositionOnPostBack() As Boolean Get Return FMaintainScrollPositionOnPostBack End Get Set(ByVal value As Boolean) FMaintainScrollPositiOnOnPostBack= value End Set End Property
''' ''' 维护滚动条位置。 ''' Private Sub DoMaintainScrollPosition() Dim oScript As StringBuilder Dim sScript As String Dim oScrollPosX As HiddenField ' 记录水平滚动条位置 Dim oScrollPosY As HiddenField ' 记录垂直滚动条位置
If Me.Page.IsPostBack Then ' 当 PostBack 时,利用 HiddenField 记录的值来恢复 Panel 滚动条位置 oScrollPosX.Value = Me.Page.Request.Form(oScrollPosX.ClientID) oScrollPosY.Value = Me.Page.Request.Form(oScrollPosY.ClientID) sScript = "Panel_RestoreScrollPosition('" & Me.ClientID & "');" Me.Page.ClientScript.RegisterStartupScript(Me.GetType(), Me.ID & "_SetPanelScroll", sScript, True) End If End Sub
Protected Overrides Sub OnLoad(ByVal e As System.EventArgs) MyBase.OnLoad(e) If Me.Visible AndAlso (Not Me.DesignMode) Then If Me.MaintainScrollPositionOnPostBack Then DoMaintainScrollPosition() ' 维护滚动条位置 End If End If End Sub End Class ```
Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ...
[详细]
Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ...
[详细]