CSS - checkboxlist

Gertie

Active member
Joined
May 8, 2003
Messages
25
Location
Belgium
I have a radiobuttonlist and a checkboxlist in my page. Now im putting a CSS on my pages wherein the INPUT class= for all the textboxes is set to make them all equal in size and color...

But now he takes this also for the radiobuttonlist: it also is a input for the HTML code.

This would not result in a problem at all when i would create a class in my CSS to assign to the radiobuttonlist or checkboxlist.
So i did.

Problem now is that he takes the ASP.NET code and makes the following HTML from it.


Code:
<table id="rblDatum" class="optievak" border="0" style="width:179px;">
		<tr>
			<td><input id="rblDatum_0" type="radio" name="rblDatum" value="nieuwer" checked="checked" /><label for="rblDatum_0">en nieuwer</label></td>
		</tr><tr>
			<td><input id="rblDatum_1" type="radio" name="rblDatum" value="ouder" /><label for="rblDatum_1">en ouder</label></td>
		</tr>
	</table>
what is terrible, because the class is on the table,not on the input: therefor the input keeps his CSS and looks like a textbox! witch is not the plan!

thanks for any help on this,
Gertie
 
Last edited by a moderator:
How do you do this?

Can you explain me how to make a Custom Control?
Ive never done that before.

Isnt there an easier way to force .NET to just put the class on the Input tag instead of the table?

Thanks for the fast reply and all.

Greetz Gertie
 
Custom controls are big thema (I have whole book about it). You can also find a lot of informations in msdn.microsoft.com

Shortly. Custom control is a class which inherits from Control or WebControl. Such class has own render function which "builds" your control (what will be sent to the browser), so you can without problems force where do you want to have for example your css-class attribute.
 
The input tag has got the layout for textboxes on it. And i have like a zillion textboxes but only 3-4 checkboxes.

Therefor a checklist gets the layout of a textbox.
And putting the cssclass on the checklistbox doesnt work.

Thats the problem. You see?

any suggestions?
greetz Gertie
 
Back
Top