the table is after the /html tag!!

yaniv

Centurion
Joined
Apr 15, 2002
Messages
167
Location
israel
I"m using this code to add table at run time:
Code:
 Dim maintable As New Table()

        Dim row As New TableRow()
        Dim cell As New TableCell()
        Dim heights As New Unit("200px")
        Dim place As New PlaceHolder()
        Dim mycontrol As UserControl = LoadControl("smallmenu.ascx")

        maintable.Height = heights
        maintable.Width = heights
        cell.Height = heights

        cell.Controls.Add(mycontrol)

        row.Height = heights
        row.Cells.Add(cell)

        maintable.Rows.Add(row)
        maintable.CssClass = "maintable"
        Page.Controls.Add(maintable)

        place.Controls.Add(mycontrol)

the problem is that the new table sits in the end of the page (after the </html> tag) so i get an error massege:
"Control '_ctl2_Button1' of type 'Button' must be placed inside a form tag with runat=server.
"

my usercontrol have buttons...

how can solve that problem?
 
Back
Top