M
mj.redfox.mj
Hello, I'm hoping someone can help me out with a very basic problem
that's got me tearing my hair out! I'm wanting to have a repeater that
adds some rows to a table as below:
<asp:Repeater ID="repeater1" runat="server">
<HeaderTemplate>
<table id="table1" runat="server">
<tr>{header code goes here}</tr>
</HeaderTemplate>
<ItemTemplate>
<tr><td>
<aspropDownList ID="ddl1" runat="server">{drop-down list code goes
here}</aspropDownList>
</td></tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
1. However, because of the 'runat="server"' in the table tag, this
throws an 'Unexpected end of file looking for </HeaderTemplate> tag'
error.
2. Removing the 'runat="server"' means that the code DOES compile -
however it seems to have the effect that whenever I try to do anything
with my drop-down list in the page-behind vb gives me a 'Object
reference not set to an instance of an object' error (not a problem
with the way I'm coding because the same line works fine in the vb if
the drop-down list is placed OUTSIDE of the table).
3. Also, the only other way I can think of to do this, to use an
<asp:table> instead (which was actually my preferred choice if I could
have got it working) gives a 'Server elements cannot span templates'
error.
Aaargghhh! There MUST be some way of having a repeater in a table as
above, AND allow server controls (that are actually useable) within
it. Can anyone help, as my head is sore from banging it against the
wall so much!
Many, many thanks indeed.
that's got me tearing my hair out! I'm wanting to have a repeater that
adds some rows to a table as below:
<asp:Repeater ID="repeater1" runat="server">
<HeaderTemplate>
<table id="table1" runat="server">
<tr>{header code goes here}</tr>
</HeaderTemplate>
<ItemTemplate>
<tr><td>
<aspropDownList ID="ddl1" runat="server">{drop-down list code goes
here}</aspropDownList>
</td></tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
1. However, because of the 'runat="server"' in the table tag, this
throws an 'Unexpected end of file looking for </HeaderTemplate> tag'
error.
2. Removing the 'runat="server"' means that the code DOES compile -
however it seems to have the effect that whenever I try to do anything
with my drop-down list in the page-behind vb gives me a 'Object
reference not set to an instance of an object' error (not a problem
with the way I'm coding because the same line works fine in the vb if
the drop-down list is placed OUTSIDE of the table).
3. Also, the only other way I can think of to do this, to use an
<asp:table> instead (which was actually my preferred choice if I could
have got it working) gives a 'Server elements cannot span templates'
error.
Aaargghhh! There MUST be some way of having a repeater in a table as
above, AND allow server controls (that are actually useable) within
it. Can anyone help, as my head is sore from banging it against the
wall so much!
Many, many thanks indeed.