repeater control and headertemplate

Results 1 to 2 of 2

Thread: repeater control and headertemplate

  1. #1
    Join Date
    Dec 1969

    Default repeater control and headertemplate

    I have a list of categories, when you click on the link it goes to a product listing page which works fine. I am using the repeater control to format the product listing page but also need to have the category name appear at the top of the page. <BR><BR>If I put the code in the headertemplate, nothing displays, but if I put it in the itemtemplate section it displays fine, but with every product whereas I only want it to display once at the top of the page.<BR><BR>This is the code I am using:<BR><BR>&#060;HeaderTemplate&#062;<BR>&#060; %# DataBinder.Eval( Container, "DataItem.cat_name")%&#062;<BR>&#060;/HeaderTemplate&#062;<BR><BR>Can anyone tell me how to get the category name to display or is it something I should be doing in the code behind page?

  2. #2

    Default RE: repeater control and headertemplate

    There seem to be quite a few strange things with headers and footers.<BR><BR>In the case you&#039;ve shown, I doubt the header has a dataitem.<BR><BR>Try using a constant value to test things.<BR>You might need to create a property in your page, and you would put your catagoryNAme into that prop just before binding.<BR>eg &#060;%="SomeText"%&#062; or &#060;%=SomeProperty%&#062;<BR><BR>If you put a literal in the header, you can FindControl to get a reference to it in the item_databound.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts