日期:2014-05-16  浏览次数:20489 次

用repeater控件导出word后,只显示HTML代码
 前台:
<table class="usertableborder" cellspacing="1" cellpadding="3" width="96%" align="center" border="0">
    
        <asp:Repeater ID="RepeatUser" runat="server" >
            <HeaderTemplate>
                <tr>
                    <th>选择</th>
                    <th>员工编号</th>
                    <th>员工名称</th>
                    <th>合同编号</th>
                    <th>手机</th>
                    <th>更新</th>
                    
                </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td class="usertablerow1"><input type="checkbox" name="chkUserList" id="chkUser" value='<%# Eval("Id") %>' /></td>
                    <td class="usertablerow1"><%#Eval("ID") %></td>
                    <td class="usertablerow1"><%#Eval("Name") %></td>
                    <td class="usertablerow1"><%#Eval("Contract") %></td>
                    <td class="usertablerow1"><%#Eval("MobilePhone") %></td>
                    <td class="usertablerow1"><a href=AddUser.aspx?id=<%#Eval("ID") %>>更新</a></td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        
    </table>
    <font size=2><p align=center><asp:Literal ID="RecordCount" runat="server"></asp:Literal>条记录
       &