如何从asp.net中的隐藏字段中获取价值,而无需提及runat服务器 [英] how to get value from hidden field in asp.net without mention runat server

查看:57
本文介绍了如何从asp.net中的隐藏字段中获取价值,而无需提及runat服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将html文本框存储到javascript中的html隐藏字段(没有runat服务器),
但是隐藏的字段在asp.net中显示空值...
我在隐藏字段中提到过runat服务器意味着它可以正常工作.
我想知道如何在asp.net中使用不带runat服务器的隐藏字段

store the html textbox to html hidden field(without runat server) in javascript,
but the hidden fields display null value in asp.net...
i mention runat server in hidden fields means its working..
i want to know how to use hidden field without runat server in asp.net

推荐答案

尝试以下操作:
Try this:
document.getElementById('TextboxId').value = document.getElementById('HiddenInputId').value; 


您可以在下面的链接中查看工作示例:
工作示例 [ ^ ]


You can see below link for working example:
Working Example[^]


Server Controls必需的属性,例如:runat="server" & ID="SomeID"因此您需要使用它.如果没有这些属性,则尝试运行应用程序,则应用程序将在编译时给出错误.而HTML 控件取决于您使用这些属性(而不是ID ,您可以在HTML中使用name ).


--Amit
Server Controls required attributes like: runat="server" & ID="SomeID" So you need to use it. Without these attributes if you''ll try to run the application, then application will give error at compile time. Whereas, HTML controls, depends upon you to use these attribute(Instead of ID you can use name in HTML).


--Amit


这篇关于如何从asp.net中的隐藏字段中获取价值,而无需提及runat服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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