How to use SeparatorTemplate with repeater

L

Lloyd Sheen

I have a repeater with header / item / alternate item and footer templates
which works great (or at least ok).

I want to put an <hr/> tag as a separator but as soon as I put that in the
output in no longer generated in any form that I can see as a pattern.

The header starts the table, the footer ends it.

The item has on <tr> with 4 <td> , the alternating item has <tr< with 3 <td>
( the 4th in the item is a <td style="width: 3px; background-color: Gray">
used to separate the item / alt item.

Any ideas??

Thanks
LS
 
L

Lloyd Sheen

Eliyahu Goldin said:
<hr> is difficult to use. Style your items with border instead. It will
have
the same effect of drawing a line.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


Lloyd Sheen said:
I have a repeater with header / item / alternate item and footer
templates
which works great (or at least ok).

I want to put an <hr/> tag as a separator but as soon as I put that in
the
output in no longer generated in any form that I can see as a pattern.

The header starts the table, the footer ends it.

The item has on <tr> with 4 <td> , the alternating item has <tr< with 3
( the 4th in the item is a <td style="width: 3px; background-color:
Gray">
used to separate the item / alt item.

Any ideas??

Thanks
LS

Thanks, in my investigations it seems that I may have attempted to use the
separator in the wrong way. I will use the border.

LS
 
M

Mark Rae [MVP]

The item has on <tr> with 4 <td> , the alternating item has <tr< with 3
<td> ( the 4th in the item is a <td style="width: 3px; background-color:
Gray"> used to separate the item / alt item.

Any ideas??

This doesn't sound right, though it's a little difficult to check without
seeing your markup and/or code...

However, the item, alternating item and separator sections need to be
written in such a way so as to produce valid output. E.g. if your repeater
is creating an HTML table, then it needs to be a valid HTML table with the
correct number of columns per row, etc...

Therefore, if your item section is one <tr> with four <td> elements, your
alternating section and separator section will need to be of the same
structure...

Does it work if you (temporarily) remove your alternating section, and make
your separator section as follows:

<tr>
<td colspan="4"><hr /></td>
</tr>
 

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

Top