You can set a Styleproperty , for example:
progressBar.Style[HtmlTextWriterStyle.Width] = "200px";
progressBar.Style["width"] = "200px";
Alternatively, you can give it a CSS class, define this in your CSS:
.progress { width: 200px; }
And assign this class in your markup as follows:
<div id="progressBar" runat="server" class="progress">
Or in your code:
progressBar.Attributes["class"] = "progress";
source
share