?
Solved

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

Posted on 2009-04-02
1
Medium Priority
?
710 Views
Last Modified: 2012-05-06
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

0
Comment
Question by:cassiec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
amar31282 earned 1500 total points
ID: 24053510
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question