datalist extracttemplaterows=true using Page.LoadTemplate

S

Steve

I hope that there is a simple answer to this question...

Does anyone know how to set the ExtractTemplateRows property of a DataList
to true when loading templates for a DataList (here, "DataList1") dynamically
using LoadTemplate without generating the error:

"A Table control was not found in the template for 'DataList1' for an item
of type 'ListItemType.Item'. "

This will occur even if there is a table in the template file. For examle:

....
DataList1.ItemTemplate = Page.LoadTemplate("template.ascx");
....
--------------------------------------
Contents of "template.ascx":
<%@ Control Language="c#" %>
<asp:Table runat=server>
<asp:TableRow>
<asp:TableCell>Test</asp:TableCell>
</asp:TableRow>
</asp:Table>

Thanks - S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top