首页 > 代码库 > Repeater在无数据记录时显示“无相关记录...”

Repeater在无数据记录时显示“无相关记录...”

<table class="r_line" cellpadding="3" cellspacing="1" width="100%">
    <tr class="r_title">
        <td>编号</td>
    </tr>
<asp:Repeater ID="rptRecord" runat="server">
    <ItemTemplate>
        <tr style=‘background-color:<%#(Container.ItemIndex%2==0)?"#fff":"#eee"%>‘>
            <td><a href=http://www.mamicode.com/‘Detail.aspx?PID=&did=‘>> 

上面是从网上看到的

我自己这么写的

   <FooterTemplate>
                    <%
                        if (rptComunicateList_Untreated.Items.Count == 0)
                    { %>
                    <div class=‘infor-block‘ style=‘text-align: center; color: #999999;‘>
                        <p>
                             没有相关记录!
                        </p>
                    </div>
                      <%}%>
                </FooterTemplate>

没啥含量,记录下来以后多用到