using cssclass with CSS IDs

D

DamienS

Hi,

Is there any way to use CSS class with the CSS ID (not to be confused
with the ASP ID)?

eg,

<style type="text/css">
#Table_01
{
position:relative;
blah blah...
}
</style>


Refering to those in 'normal' HTML, you'd use the ID property (as
opposed to class), eg
<div id="Table_01"></div>

I can't figure out how to set these on serverside controls.

Thanks very much in advance,



DamienS
 
G

Göran Andersson

DamienS said:
Hi,

Is there any way to use CSS class with the CSS ID (not to be confused
with the ASP ID)?

eg,

<style type="text/css">
#Table_01
{
position:relative;
blah blah...
}
</style>


Refering to those in 'normal' HTML, you'd use the ID property (as
opposed to class), eg
<div id="Table_01"></div>

I can't figure out how to set these on serverside controls.

Thanks very much in advance,



DamienS

It's not practical to use an id of a server control for css, as you have
to use the generated id. The html element that the control creates
doesn't get the id that the server control has, it gets an id that is
generated based on the controls parents.

You can get the generated id using the ClientID property of the server
control, but that means that you have to generate the css code using
server code.
 
G

gerry

don't use asp.net controls - then you have total control over client side
control id's.

I create subclassed asp.net server controls that allow one to specify that a
control should , based on its ID property value, render a raw id and/or name
or an asp.net mangled id - something that imho should have been built into
all controls right from the start.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,458
Latest member
Chris#

Latest Threads

Top