jimmajsterski
Well-known member
I'm new to asp.
Trying page.controls.add to add a control at runtime.
Using simple examples from MDSN and ASP.NET step by step.
This code is in the Page_Load Event of CompoundContainer.aspx.vb
Dim MyTextBox as New TextBox
Page.Controls.Add(MyTextBox)
When I browse CompoundContainer.aspx, I get this msg:
Exception Details: System.Web.HttpException: Control '_ctl0' of type 'TextBox' must be placed inside a form tag with runat=server
Must be a beginner mistake, but I am puzzled, any help out there?
Thanks.
Trying page.controls.add to add a control at runtime.
Using simple examples from MDSN and ASP.NET step by step.
This code is in the Page_Load Event of CompoundContainer.aspx.vb
Dim MyTextBox as New TextBox
Page.Controls.Add(MyTextBox)
When I browse CompoundContainer.aspx, I get this msg:
Exception Details: System.Web.HttpException: Control '_ctl0' of type 'TextBox' must be placed inside a form tag with runat=server
Must be a beginner mistake, but I am puzzled, any help out there?
Thanks.
Last edited: