CheckBox List Formatting question

Discussion in 'ASP .Net Web Controls' started by Burak, Sep 25, 2003.

  1. Burak

    Burak Guest

    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
    Burak, Sep 25, 2003
    #1
    1. Advertising

  2. 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

    >-----Original Message-----
    >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
    >.
    >
    Fredrik Normén NSQUARED, Sep 25, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    0
    Views:
    487
    tshad
    Apr 15, 2005
  2. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,360
    ThunderMusic
    Jan 25, 2006
  3. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    784
    David Wier
    Oct 6, 2006
  4. Jason Huang
    Replies:
    0
    Views:
    525
    Jason Huang
    Jun 29, 2007
  5. Oltmans
    Replies:
    2
    Views:
    251
Loading...

Share This Page