I have an ascx control has of DataGrid. My problem is that when I use the render control on the other page it has the error as follows: Checkbox must be placed inside a form tag with runat="server"

The checkbox was created dynamically in VB not in the HTML side. I suspected that this was the cause of the problem. How can I set the checkbox to has attribites <runat="server">?

I have tried the ff code but still it doesn't work:

Dim chk As CheckBox
Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)
chk = New CheckBox()
htmlWrite.Write("<script>runat=server</script>")
chk.Attributes.AddAttributes(htmlWrite)

thanx