In my repeater I have the following markup:
<asp:Repeater runat="server" id="TeamsRepeater" OnItemDataBound="TeamsRepeater_ItemDataBound" ClientIDMode="Predictable">
<ItemTemplate>
<tr runat="server" id="team">
<td><%# Container.ItemIndex + 1 %></td>
<td><%#Eval("PosChange")%></td>
<th><%# ((ITeam)Eval("MemberTeam")).Href()%></th>
<td><%#Eval("GamesAll")%></td>
<td><%#Eval("GameW")%></td>
<td><%#Eval("GameD")%></td>
<td><%#Eval("GameL")%></td>
<td><%#((ITournMember)Container.DataItem).Goals()%></td>
<td><%#Eval("Score")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
That is pretty readable (and maintainable, please point me if you see something can be done better).
But my concern is that HTML code generated for this markup contains a huge amount of spaces...
How could I enhance that in order:
You could try this HttpModule that removes whitespace.
I wouldn't sacrifice readability to get rid of spaces. This will hurt you in the long run. Instead enable compression for your dynamic content, i.e. with IIS HTTP Compression - the end result will be dynamic gzip compression on your aspx pages that are much smaller than your plain HTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With