Gertie Posted June 11, 2003 Posted June 11, 2003 (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 June 12, 2003 by Robby Quote
hrabia Posted June 11, 2003 Posted June 11, 2003 Hmm, probably you have to write your own list as custom control and render it according to your requirements. Quote A man and a dog have an average of three legs. Beaware of Statistics.
Gertie Posted June 11, 2003 Author Posted June 11, 2003 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 Quote
hrabia Posted June 12, 2003 Posted June 12, 2003 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. Quote A man and a dog have an average of three legs. Beaware of Statistics.
Moderators Robby Posted June 12, 2003 Moderators Posted June 12, 2003 Are you placing your controls at design-time? Why can't you just put the Class into the Input tags? Quote Visit...Bassic Software
Gertie Posted June 12, 2003 Author Posted June 12, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.