How to apply CSS class dynamically?

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

With the help of Control'Style property,we can apply css at run-time,suppose i want to set Body background color,then we will write as:-
<body id="bdy" runat="server">

</body>
Then on code behind,
bdy.Style["Background-Color"] = LightYellow;


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response