Possible Duplicate:
Default textbox border-style and width
I have some TextBox on my page that should be red bordered from the code behind.
But the Multiline TextBox that present a vertica scrollbar, does not show the border from its side.
Here is my code that set the border:
foreach (var str in idsRequired)
{
var ctrl = (WebControl)FindControl(str);
if (ctrl != null)
ctrl.Style.Add(HtmlTextWriterStyle.BorderColor, "red");
}
I get controls by ID and the set theyr border.
Question is: how can i correctly border all the TextBox control?
EDIT
I finnaly end up with setting the border style to 2px and the right border appear. As you can see here:

How can you explain this?
As an advice, try to delegate the style of your controls to CSS files or ASP.Net themes. Why? Because you usually would want to reuse the same style across your website and imagine when you want to change the style again (which in a real application happens a lot), you would have to edit your code directly potentially introducing some undesired bugs, so avoid this and just separate your design from your code
You could declare the style in a CSS file and just import it to your page:
Using CSS
}
In your control
Remember to place your CSS file under the Theme folder and add the following directive to the page to import automatically all the CSS files to your page
Or you could create an ASP.Net theme to accomplish the same effect:
In your skin file:
Remember you need to specify the theme:
And this is the result