繁体   English   中英

twitter bootstrap,html控件和asp.net代码背后

[英]twitter bootstrap, html controls and asp.net code behind

我正在使用twitter bootstrap和asp.net开发的网站上工作。

我想知道如何从代码隐藏页面访问html控件。 例如,

<div class="control-group">
<label class="control-label" for="name">
Your Name</label>
<div class="controls">
                <input type="text" class="input-xlarge" name="ApplicantName" id="AppName" placeholder="First Name and Last Name" >
            </div>
        </div>

如何获取或设置ApplicantName文本框的值?

向控件添加runat属性并将值设置为server并且可以在代码隐藏中访问它。

<input type="text" id="txtName" runat="server" />

现在在代码隐藏中,您可以访问它。

txtName.Value="this is set from codebehind";

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM