[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2009-04-02
1
Medium Priority
?
712 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Suggested Courses

650 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