How do we set border style through code-behind?

 Posted by vishalneeraj-24503 on 6/5/2014 | Category: ASP.NET Interview questions | Views: 2669 | Points: 40

We have control's BorderStyle property and it has BorderStyle ENUM which is to be assigned to control border style.BorderStyle ENUM has the same values which border-style CSS property has.

For Example:-
Suppose,i have a button control like below whose border style i have to set
<asp:Button ID="Button4" runat="server" Text="Button"/>

<asp:Button ID="Button5" runat="server" Text="Button"/>

In the code behind,
We will write:

Button4.BorderStyle = BorderStyle.Solid;
Button5.BorderStyle = BorderStyle.Dotted;

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response