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" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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...?

Akkiraju IvaturiRank #474 · 5.2K pointsPosted Jan 17, 2013, 3:47 AM EST
Then in the code behind:
YourDIVID.Attributes["class"]="your css class name";
This adds the class attribute to the DIV tag.