I thought IDs had to be unique on a web page.
DotNet, adds a number at the end of IDs in a GridView row when the Grid is rendered so you will have unique IDs. But it doesn't do that for Headers and Footers (and the yet the page works fine).
If you have something like:
The rendered code may be:
At the top of the Grid
And at the bottom of the Grid
the ID's for the span are identical, how can that be???
Thanks,
Tom
DotNet, adds a number at the end of IDs in a GridView row when the Grid is rendered so you will have unique IDs. But it doesn't do that for Headers and Footers (and the yet the page works fine).
If you have something like:
Code:
<asp:TemplateField ItemStyle-HorizontalAlign="Right" ItemStyle-VerticalAlign="Middle"
ItemStyle-Width="80px">
<HeaderTemplate>
<asp:Label ID="lblQuantityTotal" Text="" runat="server"></asp:Label>
</HeaderTemplate>
<FooterTemplate>
<asp:Label ID="lblQuantityTotal" runat="server"></asp:Label>
</FooterTemplate>
</asp:TemplateField>
The rendered code may be:
At the top of the Grid
Code:
</th><th align="center" scope="col" style="border-color:Black;border-width:2px;border-style:solid;font-weight:bold;">
<span id="[b]MainPlaceHolder_mGridView_lblOrderQuantityTotal[/b]">291</span>
And at the bottom of the Grid
Code:
</td><td align="center" style="border-color:Black;border-width:2px;border-style:solid;font-weight:bold;">
<span id="[b]MainPlaceHolder_mGridView_lblOrderQuantityTotal[/b]">291</span>
the ID's for the span are identical, how can that be???
Thanks,
Tom