从后面的代码访问HTML5控件 [英] Access HTML5 control from code behind
本文介绍了从后面的代码访问HTML5控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从代码后面的代码访问HTML5控件
How Can I Access HTML5 control from code behind
推荐答案
查看此内容
ASP.Net MVC的HTML 5控件 [ ^ ]
假设您要在后面的代码中访问此文本框值而不是添加属性 - runat =服务器
现在代码背后 -
string username = UserName.Value;
Suppose you want to access this textbox value in code behind than add attribute - runat="server"
now in code behind-
string username = UserName.Value;
使用 runat =server属性作为服务器的Control控制并可以使用控件的ID访问它。
Use runat="server" attribute for the Control which makes it a Server Control and can accessed it with the Id of the Control.
这篇关于从后面的代码访问HTML5控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文