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

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'