tate Posted August 1, 2007 Posted August 1, 2007 Is there a way to add information from an XML file into the repeater control's HeaderTemplate? I have no problem displaying XML information in the ItemTemplate but I receive the following exception when I place data in the HeaderTemplate. "Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: container" ~~~~~~~~~~~~~~~~~~~~~ Code ~~~~~~~~~~~~~~~~~~~~~~ <asp:Repeater id="rpSeries" DataSourceID="XmlDataSource1" runat="server"> <HeaderTemplate> <font size="+1"><strong>Current Sermon Series: <br /><br /> <%#XPath("Title")%> </strong></font> </HeaderTemplate> <ItemTemplate> <div class="content"> <br /><br /> <Strong><%#XPath("Date")%> <%#XPath("Sermon")%> <br /> </Strong> <%#XPath("Scripture")%> <br /><br /> <%#XPath("Text")%> <br /> </div> </ItemTemplate> <FooterTemplate> </FooterTemplate> </asp:Repeater> Quote
shaul_ahuva Posted August 8, 2007 Posted August 8, 2007 Header items don't have associated data items, so you'll need to either handle the ItemDataBound event and populate the value when you're working with a header item (e.Item.ItemType = ListItemType.Header) or you'll need to call a custom method on the page to populate the vaule. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.