Very Weird Repeater Problem

H

Hong

Hi,

I have been scratching my head over this problem for hours, the repeater
control I am using would only render the controls specified in
HeaderTemplate and FooterTemplate, but the repeater will not render the
controls in ItemTemplate and AlternateItemTemplate.

ItemDataBound event is fired appropriately, just the rendering seems to
be messed up. The real funny part about this problem, is that it happens
only on a specific website of an IIS installation. Why does the repeater
control refuse to render itself? Are there any specific situations where
a repeater will not render itself properly? No error, no warning,
nothing...the HTML is just not there.

I'm shooting in complete darkness here...

Hong
 
P

psycho

Hi,

I have been scratching my head over this problem for hours, the repeater
control I am using would only render the controls specified in
HeaderTemplate and FooterTemplate, but the repeater will not render the
controls in ItemTemplate and AlternateItemTemplate.

ItemDataBound event is fired appropriately, just the rendering seems to
be messed up. The real funny part about this problem, is that it happens
only on a specific website of an IIS installation. Why does the repeater
control refuse to render itself? Are there any specific situations where
a repeater will not render itself properly? No error, no warning,
nothing...the HTML is just not there.

I'm shooting in complete darkness here...

Hong

Hi Hong,

I believe that you are not calling the Databind method of repeater.

Please check if the method is being called properly.
Otherwise the problem could be that the collection you are binding it
is empty.

thanks,
santiago
 
H

Hong

Hi psycho,

I just did away with the repeater and used datalist instead. I think I
know why, I wrote the repeater as such:

<asp:Repeater ID="rptrStuffs" runat="server">
<asp:HeaderTemplate>
<table>
<thead>
<th>...
</th>
</thead>
<tbody>
</asp:HeaderTemplate>
<asp:ItemTemplate>
<tr>s...
</asp:ItemTemplate>
<asp:AlternatingItemTemplate>
<tr>s...
</asp:AlternatingItemTemplate>
<asp:FooterTemplate>
</tbody>
</table>
</asp:FooterTemplate>
</asp:Repeater>

Notice that table and tbody tags are split across different templates
inside the repeater. I think this chokes the internal rendering logic of
repeater somewhere deep down Microsoft's implementation, under very
special conditions that I have no idea about.

I used datalist with ExtractTemplateRows and that solved the problem
nicely while achieving what I tried to do with the repeater.

Oh, the datasource was not empty, the databind method of repeater was
called. I checked those during the few hours of scratching my head ;)

Hong
 

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

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top