Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I have a radiobuttonlist and a checkboxlist in my page. Now i'm 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.

 

 

<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

Edited by Robby
Posted
Hmm, probably you have to write your own list as custom control and render it according to your requirements.

A man and a dog have an average of three legs.

Beaware of Statistics.

Posted

How do you do this?

 

Can you explain me how to make a Custom Control?

I've never done that before.

 

Isn't 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

Posted

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.

A man and a dog have an average of three legs.

Beaware of Statistics.

Posted

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 doesn't work.

 

That's the problem. You see?

 

any suggestions?

greetz Gertie

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...