admin管理员组文章数量:1334825
How can I access the content of hidden field, where the hiddenfiled's visibility set to Visible=false
in the server side using C#. I am not in a situation to use CSS's display:none
instead of Visible=false
.
How can I access the content of hidden field, where the hiddenfiled's visibility set to Visible=false
in the server side using C#. I am not in a situation to use CSS's display:none
instead of Visible=false
.
3 Answers
Reset to default 5If Visible
is false
, then the control did not go down to the client, so you cannot directly access it from javascript: it simply isn't there.
Equally, since it is a HiddenField
(i.e.<input type="hidden"...>
), there is no need to set display:none
- it will never be visible, even if Visible
is true
(although, it will be in the source).
So: either set Visible
to true
, or e back to the server to get that value.
When you set Visisble=false
on the server side it won't actually render the control in the page so there is no way to get the value on the client side.
If you really can't put the value in the page some other way you could do an AJAX request to get the value when you need it?
You can't - these fields are not being rendered to the client side.
本文标签: javascriptAccess hidden fields value if its Visibility set to false(using C)Stack Overflow
版权声明:本文标题:javascript - Access hidden fields value if its Visibility set to false(using C#) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742369536a2461958.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论