Reputation: 1
<asp:TextBox ID="givennametb" runat="server" BackColor="White" ForeColor="Black" Width="145px" CssClass="textbox"></asp:TextBox>
<asp:TextBox ID="familynametb" runat="server" BackColor="White" ForeColor="Black" Width="145px"></asp:TextBox>
I wrote this piece of code. Now I want to change bordercolor
of givennametb
textBox
to blue and familynametb
to red.
I do not want to do it inline withBorderColor:"blue/red"
. I want to use CSS/CSSClass. I am using C# with ASP.NET. If I do cssClass="textbox"
and try to change in style, all tags are changing to same color. I want to change separately.
Upvotes: 0
Views: 399
Reputation: 317
Remember, ASP.Net is going to render the control ASP:Text for the web browser in a <Input type="text">
of a <form>
HTML, so you can use a CCS Selector with the Id of control to modify the border color of textBox.
input#givennametb{
border:1px solid blue;
}
input#familynametb{
border:1px solid red;
}
<input id="givennametb" type="text" />
<input id="familynametb" type="text" />
Upvotes: 1
Reputation: 317
input.textbox#givennametb{
border:1px solid blue;
}
input.textbox#familynametb{
border:1px solid red;
}
<input id="givennametb" type="text" class="textbox" />
<input id="familynametb" type="text" class="textbox" />
Upvotes: 0