Solved

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

Posted on 2009-04-02
1
702 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
1 Comment
 
LVL 14

Accepted Solution

by:
amar31282 earned 500 total points
ID: 24053510
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
align Linkedin sign to the right page 5 36
What can cause the styling on a .NET site to not be found? 17 26
imap mails 1 23
Create CSS Animation for Page Transitions 4 26
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

809 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