CheckBox List Formatting question

B

Burak

Hello,

I have a checkbox list control, "check1" , on my
page.
After I do the databind, here is what the view source
looks like.

<table id="check1" border="0">
<tr><td>
<input id="check1_0" type="checkbox" name="check1:0"
/><label for="check1_0">Child Care</label></td>
</tr><tr><td>
<input id="check1_1" type="checkbox" name="check1:1"
/><label for="check1_1">Clothing / Uniform
Allowance</label></td></tr>
</table>

Is there a way to capture/modify this html before it
gets sent to the client and change "<td>" into
"<td align='right' valign='top'>" ???

Barring that, is there a custom control that lets me do the
above? I do not know much about custom controls and would like
to create one if I have to, but would prefer to use an existing
microsoft/custom control. :)

Thank you,

Burak
 
F

Fredrik Normén NSQUARED

You can add runat="server" and the id attribute to the
<td> element:

<td id="myCell" runat="server">

In your code-behind add:
protected System.Web.UI.HtmlControls.HtmlTableCell myCell;

When this is done you can access this <td> in your code.

myCell.Align = "Right";
myCell.VAlign = "Top";

/Fredrik Normén NSQUARED
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top