Load usercontrols through the code

Blessybaby
Posted by Blessybaby under ASP.NET category on | Views : 1729
in web page source

<asp:PlaceHolder ID="phOrderList" runat="server">
</asp:PlaceHolder>
in code bebind page
Control control = LoadControl(Page.ResolveUrl("~/Controls/OrderListInfo.ascx"));
this.phOrderList.Controls.Clear();
this.phOrderList.Controls.Add(control);

Comments or Responses

Login to post response