Dynamic controls in combination with masterpage


hey folks,

i want add controls dynamically webpage, use in combination masterpage.

when try add control in page_load event way

button mybutton = new button();
this.controls.add(mybutton);

i encounter exception @ runtime says "the control ctl01 of type button needs put inside form-tag runat=server". (it's not original message, had translate it)

my masterpage looks this:

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>unnamed site</title>
</head>
<body>
    <form id="form1" runat="server">
   <div>
        <asp:contentplaceholder id="contentplaceholder1" runat="server">
        </asp:contentplaceholder>
   </div>
    </form>
</body>
</html>

without masterpage, works. should work using 1 well. can me this, please?

 yes, know.  no manual, searching hours.... days... real name of controls (or may containers knows!?).  no reply, yes know join club.

delivering package without proper manual?! ah! not it?

patricia marchand


Archived Forums A-B  >  ASMX Web Services and XML Serialization



Comments

Popular posts from this blog

SQL Server 2008 - High Memory Usage

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

Problem In Configuring Biztalk 2009 In Creating A ReceivePort.When I Try To Create A Receive POrt I Got This Error