I want to apply stylesheet dynamically on
, which i have created in design time.
I have only 1 .aspx webpage, which i have created in visual studio 2010.
My default.aspx page code as below:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
Now i want to apply stylesheet on above div with "testing" id.
I want to apply these stylesheet properties with div:
background-color
border
width
height
font
I have did this task by using javascript but now i want to do this using c#.
How can i do it, plz help me...?
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Akkiraju IvaturiPosted Jan 17, 2013, 8:47 AM
Then in the code behind:
YourDIVID.Attributes["class"]="your css class name";
This adds the class attribute to the DIV tag.