• 0

Stylesheets and ASP.NET


Question

3 answers to this question

Recommended Posts

  • 0

In the code behind your aspx page (right-click in the Solution Explorer and choose View Code), in the Page_Load method, you can set your label's style by adding an attribute to it.

// say your asp:label has an id of myLabel

myLabel.Attributes.Add("style", "background-color:#ffffff; border:1px;");

...

You need to compile the code after you make any changes.

You could also create a stylesheet, and appy the style to the label through the CssClass property of the label.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.