views:

3

answers:

0

Hi everyone.

I have a custom control created in codebehind, and I have in the same control an ordinary asp.net button. Like this:

        protected void Page_Load(object sender, EventArgs e)
    {
    }

    private void MyTable()
    {
        Table table = new Table();

        TableRow row = new TableRow();
        TableCell cell = new TableCell();

        CheckBox check = new CheckBox();
        check.ID = "theId";
        check.Text = "My Check";
        check.AutoPostBack = true;
        cell.Controls.Add(check);
        row.Cells.Add(cell);

        table.Rows.Add(row);
        this.Controls.Add(table);
    }

    protected override void CreateChildControls()
    {
        MyTable();
        base.CreateChildControls();
    }

And in the asmx something like this:

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyUserControl.ascx.cs" Inherits="Tester.MyUserControl" %>
<asp:Button ID="Button1" runat="server" Text="Button" />

ok... now. When I render my control it looks like:

[BUTTON]

[ ] My Check

But I really need that the button render after the checkbox. Any idea how can I do that?