Link to home
Start Free TrialLog in
Avatar of cassiec
cassiec

asked on

ASP.NET Programmatically assign CSS ID to a <div>

I have a sample ASPX page with a few styles assigned (see code below)
Styles were created in VS2008

1)  I want to programmatically (using VB) add a DIV in the page and want the freedom of using a choice of the EXISTING styles currently defined in the style section of the aspx page, without having to recode the styles - some code examples will be appreciated.

2) Is it possible to place a general div in the aspx page and change its id programmatically - although I suppose this is possible ? - but rather to use a placeholder ?

Any suggestiions welcome

Thanks

Cassie



Part of ASPX page......
 
<style type="text/css">
        #div01
        {
            background-color: #FFFFCC;
            width: 200px;
            height: auto;
        }
        .teststyle01
        {
            background-color: #99CCFF;
            width: 500px;
            height: 200px;
        }
        #divtop
        {
            background-color: #66FF33;
            width: 500px;
            height: 200px;
        }
    </style>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of amar31282
amar31282
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial