Reputation: 11652
How can I assign value to
<input type="email" class="form-control" placeholder="User name" required="" autofocus="" name="txtEmailId" id="txtEmailId" />
in the code behind?
Upvotes: 0
Views: 4229
Reputation: 40970
Use runat="server"
with markup
<input type="email" runat="server" class="form-control" placeholder="User name" required="" autofocus="" name="txtEmailId" id="txtEmailId" />
Now on code behind you can access it via txtEmailId
As Html 5 control is not available using runat attribute. You can directly use the TextBox like this
<asp:TextBox ID="txtEmailId" runat="server" TextMode="Email"></asp:TextBox>
Upvotes: 2