how to set up runat="server" in webcontrol



How can I set up runat="server" in dynamic added UserControl ?

I have my control created in designer. When I use drag & drop
to implement it in website it works.

when I use code:

Control zlecenie = new Control();
z = LoadControl("~/UserControls/Z.ascx");
z.ID = "z1";
Controls.Add(z);

an error has occured:

"Control 'z_ResizableControlExtender1_ClientState' of type 'HiddenField'
must be placed inside a form tag with runat=server."

so what I'm doing wrong ?


.