IE7 ItemTemplate Css distortion

487 Views Asked by At

I am getting a css display error in IE7 only when I insert <div> tags inside an <ItemTemplate>. When I remove the <div> tags directly inside the <itemtemplate> the list is displayed correctly. Is there a problem with IE7 and itemTemplate options?

<asp:Repeater ID="rTracks" runat="server" OnItemDataBound="rTracks_ItemDataBound" EnableViewState="true">
                <ItemTemplate>
                    <div style='display: <asp:Literal ID="ltSongTrack" runat="server" Text="block" />;'>
                        <li onclick="hasKaraokeChanges=false;" class='admin-song ui-selectee <asp:Literal id="ltStatusClass" runat="server" />' mediaid="<%# Eval("MediaId") %>" artistid="<%# Eval("tbMedia.tbArtists.id") %>"><span class="handle"><strong style="display:none;">
                        <%--<%# int.Parse(DataBinder.Eval(Container, "ItemIndex", "")) + 1%>--%><%# Eval("SortNumber")%></strong><%--0:03--%></span> <span class="play"><span class="btn-play">&nbsp;</span></span> <span class="track" title="<%# Eval("tbMedia.Title") %>">
                            <%# Eval("tbMedia.Title") %></span> <span class="artist">
                                <%# Eval("tbMedia.tbArtists.Name") %></span> <span class="time" length="<%# Eval("tbMedia.Length") %>">
                                    <asp:Literal ID="ltRuntime" runat="server" /></span> <span class="notes"><span class="btn-notes">
                                        <asp:Literal ID="ltNotesCount" runat="server" /></span></span> <span class="status">
                                            <asp:Literal ID="ltStatus" runat="server" /></span> <span class="date">
                                                <%# Eval("DateAdded") %></span> <span id="spanStatus" class="remove"><asp:LinkButton ID="lbStatusClass2" OnClientClick="isSortingOrChangingStatus=true;isChangingStatus=true;" runat="server" CssClass="btn-del" OnClick="UpdateStatus" ValidationGroup='<%#Bind("MediaId") %>'>
                                                    <%--<span id="span<%# Eval("MediaId") %>" onclick="ChangeStatusClick(this,<%# Eval("MediaId") %>)" mediaid="<%# Eval("MediaId") %>" class='<asp:Literal id="ltStatusClass2" runat="server" Text="btn-del" />'>--%>
                                                    &nbsp;<%--</span>--%></asp:LinkButton></span></li>
                     </div>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <div style='display: <asp:Literal ID="ltAltSongTrack" runat="server" Text="block" />;'>
                <li onclick="hasKaraokeChanges=false;" class='admin-song ui-selectee <asp:Literal id="ltStatusClass" runat="server" /> alt' mediaid="<%# Eval("MediaId") %>" artistid="<%# Eval("tbMedia.tbArtists.id") %>"><span class="handle"><strong style="display:none;">
                        <%--<%# int.Parse(DataBinder.Eval(Container, "ItemIndex", "")) + 1%>--%><%# Eval("SortNumber")%></strong><%--0:03--%></span> <span class="play"><span class="btn-play">&nbsp;</span></span> <span class="track" title="<%# Eval("tbMedia.Title") %>">
                            <%# Eval("tbMedia.Title") %></span> <span class="artist">
                                <%# Eval("tbMedia.tbArtists.Name") %></span> <span class="time" length="<%# Eval("tbMedia.Length") %>">
                                    <asp:Literal ID="ltRuntime" runat="server" /></span> <span class="notes"><span class="btn-notes">
                                        <asp:Literal ID="ltNotesCount" runat="server" /></span></span> <span class="status">
                                            <asp:Literal ID="ltStatus" runat="server" /></span> <span class="date">
                                                <%# Eval("DateAdded") %></span> <span id="spanStatus" class="remove"><asp:LinkButton ID="lbStatusClass2" OnClientClick="isSortingOrChangingStatus=true;isChangingStatus=true;" runat="server" CssClass="btn-del" OnClick="UpdateStatus" ValidationGroup='<%#Bind("MediaId") %>'>
                                                    <%--<span id="span<%# Eval("MediaId") %>" onclick="ChangeStatusClick(this,<%# Eval("MediaId") %>)" mediaid="<%# Eval("MediaId") %>" class='<asp:Literal id="ltStatusClass2" runat="server" Text="btn-del" />'>--%>
                                                    &nbsp;<%--</span>--%></asp:LinkButton></span></li>
                     </div>
                </AlternatingItemTemplate>
            </asp:Repeater>
1

There are 1 best solutions below

1
On

Setting the display to block can cause rendering to change. Also I would make sure you have your CSS resets in place just to eliminate any possibility of inconsistent behavior.