簡體   English   中英

輸入類型=“電子郵件”設置值在asp.net代碼后面

[英]input type=“email” set value in asp.net code behind

我該如何賦值給

<input type="email" class="form-control" placeholder="User name" required="" autofocus="" name="txtEmailId" id="txtEmailId" /> 

在代碼背后?

使用帶標記的runat="server"

<input type="email" runat="server" class="form-control" placeholder="User name" required="" autofocus="" name="txtEmailId" id="txtEmailId" /> 

現在txtEmailId代碼,你可以通過txtEmailId訪問它

由於使用runat屬性無法使用Html 5控件。 您可以像這樣直接使用TextBox

<asp:TextBox ID="txtEmailId" runat="server" TextMode="Email"></asp:TextBox>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM