<asp:PlaceHolder EnableTheming="True|False" EnableViewState="True|False" ID="string" OnDataBinding="DataBinding event handler" OnDisposed="Disposed event handler" OnInit="Init event handler" OnLoad="Load event handler" OnPreRender="PreRender event handler" OnUnload="Unload event handler" runat="server" SkinID="string" Visible="True|False" > </asp:PlaceHolder>
<%@ Page Language="C#" Debug="true" %> <script runat="server"> void Page_Load(object sender, EventArgs e) { Label newCtrl= new Label(); newCtrl.Text = "Input Your Name : "; PlaceHolder1.Controls.Add(newCtrl); TextBox newCtrl2 = new TextBox(); newCtrl2.ID = "txtName"; PlaceHolder1.Controls.Add(newCtrl2); Button newCtrl3 = new Button(); newCtrl3.ID = "btnSubmit"; newCtrl3.Text = "Submit"; PlaceHolder1.Controls.Add(newCtrl3); } </script> <html> <head> </head> <body> <form runat="server"> <asp:PlaceHolder id="PlaceHolder1" runat="server"></asp:PlaceHolder> <hr /> <asp:Label id="lblText" runat="server"></asp:Label> </form> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท