Access an asp:hiddenfield control in JavaScript

前端 未结 6 1750
南旧
南旧 2020-12-21 00:10

What is the best way to access an ASP.NET HiddenField control that is embedded in an ASP.NET PlaceHolder control through JavaScript? The Visible attribute is set to false i

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-21 00:52

    If the Visibility is set to false server-side, the placeholder won't be rendered and you won't be able to access anything inside it from JavaScript. Your code should work when the placeholder is visible="true"

    Get rid of the placeholder, leave the hidden field empty at first, after the search populate it.

提交回复
热议问题