在asp.net中显示html的隐藏控件的值 [英] Show value of hidden control of html in asp.net

查看:81
本文介绍了在asp.net中显示html的隐藏控件的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在运行时为隐藏字段设置了一个值,但是在浏览器中看不到它的值,因此如何在没有服务器控制的情况下如asp:label
来显示它
在此先感谢

Hi,

I set a value to a hidden field at run time but its value not visible in the browser so how to show it without server control like asp:label

Thanks in advance

推荐答案

HiddenField本身描述它在窗体上不可见,

或如果要在表单上显示隐藏的字段值,
在任何客户端控件(即<span>)中使用Javascript进行显示.

您可以加入此主题以获取更多详细信息.
http://forums.digitalpoint.com/showthread.php?t=86845 [ ^ ]

如果有帮助,请 投票 接受答案 .
HiddenField itself depict that it is not visible on the form,

or If you want to show hidden field value on the form,
Show it using Javascript inside any client controls i.e <span>.

You could join this thread for further details.
http://forums.digitalpoint.com/showthread.php?t=86845[^]

Please vote and Accept Answer if it Helped.


什么是使用服务器控件时出现问题..

Response.Write(您的代码");
what is the problem in using server control..

Response.Write("your code");




您可以获取隐藏字段的值,例如:
Hi,

You can get the value of hidden field like:
function getValue()
{
   var hvalue = document.getElementById('<%= hdnValueField.ClientID %>').value;
   alert(hvalue);
}


如有任何疑问,请让我知道.

如果有帮助,请提供"投票",如果这是正确的答案,请提供"接受答案".

谢谢,
Imdadhusen


Please do let me know, if you have any doubt.

Please provide "Vote" if this would be helpful, and make "Accept Answer" if this would be correct answer.

Thanks,
Imdadhusen


这篇关于在asp.net中显示html的隐藏控件的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆