首页 新闻 会员 周边 捐助

ASP.NET中REPEATER下的TABLE显示不了

0
悬赏园豆:5 [已解决问题] 解决于 2014-02-09 17:38

  <asp:Repeater ID="Repeater1" runat="server">
                                <ItemTemplate>
                                 <table width="100%" border="1" class="gb_table">
                                    <tr>
                                        <td width="19%" style="color: red; font-weight: bold; padding: 5px;">
                                            第30条
                                        </td>
                                        <td width="81%" style="padding: 5px;" align="right">
                                            <img src="images/qq.gif" width="16" height="16" /><%#Eval("qq") %>
                                            <img src="images/email.gif" width="14" height="15" /><%#Eval("email") %>
                                            <img src="images/url.gif" width="16" height="16" /><%#Eval("url") %>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td rowspan="2">
                                            <img src="images/boy.gif" width="70" height="55" />
                                        </td>
                                        <td align="left" valign="top" style="padding: 5px;">
                                            <span class="boldfont">姓名:</span><%#Eval("username") %><br /><span class="boldfont">内容:</span><br />
                                            <%#Eval("body") %>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="top">
                                           <%#Eval("createdate") %>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" bgcolor="#CCCCCC" style="padding: 5px;">
                                            <span class="redfont">管理员回复:</span><br />
                                            <%#Eval("replay") %>
                                        </td>
                                    </tr>
                                </table>
                                </ItemTemplate>
                                </asp:Repeater>

 

这段代码REPEATER中的内容在VS2010的设计试图中可以显示,但是到实际网页中就显示不了,请问是为什么啊,怎么才能显示TABLE里面内容

辉笑的主页 辉笑 | 初学一级 | 园豆:86
提问于:2014-02-08 19:35
< >
分享
最佳答案
0

将<table>放在<HeaderTemplate>中

<HeaderTemplate>
<table width="100%" border="1" class="gb_table">
</HeaderTemplate>

将</table>放在<FooterTemplate>中

<FooterTemplate>
    </table>
</FooterTemplate>

 

收获园豆:5
dudu | 高人七级 |园豆:30925 | 2014-02-09 12:44
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册