I'm fairly new in asp.net, and I am more proficient at building html/php websites.I am trying to add twitter bootstrap to my textboxes. My current textbox shows:
<asp:TextBox ID="UserName" runat="server" Width="250px" TabIndex="1"></asp:TextBox>
And the input that I designed using html is:
<input type="text" class="form-control input-lg" placeholder="Username">
How do I put all the classes of my textbox to my asp textbox, and would it take effect in a similar way html elements work?
You can put these classes in asp textbox using CssClass as follows
<asp:TextBox ID="UserName" runat="server" CssClass="form-control input-lg"
Width="250px" TabIndex="1"></asp:TextBox>
Basically when you create a control asp control it render as a html control on the browser.
So in the browser you will see the same.
There may be difference in the id and the name of the control. As they are generated depending on the controls like master page and user controls.
Though you have different ClientIdMode in asp.net to overcome this issue.
MSDN for the same is http://msdn.microsoft.com/en-us/library/system.web.ui.clientidmode.aspx
<asp:TextBox ID="UserName" runat="server" CssClass="form-control input-lg"
Width="250px" TabIndex="1" placeholder="Username"></asp:TextBox>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With