Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.ascx

Status
Not open for further replies.

fmardani

Programmer
Jul 24, 2003
152
I am getting the following error and can not resolve the problem.
The Error is: 'HtmlTable' cannot have children of type 'datagrid.ascx'

I am basically trying to load an .ascx into a cell of a table
Thanks
 
Put the following tag at the top of you aspx page

<%@ Register TagPrefix=&quot;uc1&quot; TagName=&quot;WebUserControl1&quot; Src=&quot;WebUserControl1.ascx&quot; %>


Where the TagName and Src point to your ascx control.

Next put this tag into the html cell

<uc1:WebUserControl1 id=&quot;mycontrol&quot; runat=&quot;server&quot; />


That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Instead of loading the user control directly into a table cell, put a PlaceHolder control inside the table cell and load your ascx into the PlaceHolder:
Code:
<td>
  <asp:PlaceHolder ID=&quot;plControlHolder&quot; Runat=server />
</td>

plControlHolder.Controls.Add(Page.LoadControl(&quot;myControl.ascx&quot;));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top