How To: add dynamically HiddenField in masterpage base page

最后都变了- 提交于 2019-12-06 04:44:07
Public Class MyBaseMaster
    Inherits MasterPage

    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
      If Not Page.IsPostBack Then
         Page.ClientScript.RegisterHiddenField("MyHiddenField1", "initialvalue")
      End If
    End Sub
End Class

You can access the HiddenField's value via Request.Form("MyHiddenField1") (since it's not a servercontrol, it isn't part of the page's control-collection).

MSDN: HttpRequest.Form-Property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!