0

使用下面的代码,当我的 apsx 页面生成为 PDF 页面时,我尝试在列表视图控件的每两行之后分页...但是有些它不起作用..有人可以在这里检查我做错了什么或建议任何其他方法来实现它

<asp:ListView ID="ListView1" runat="server"  
    DataSourceID="DS_DvtImages" GroupItemCount="2">
        <ItemTemplate>

            <td id="Td1" runat="server"   class='<%# ((ListViewDataItem)Container).DisplayIndex % 2 == 0 ?  "page-break-before: always" : "" %>'    style="color: #333333; border-style:solid;"  >
                <asp:Image ID="Image1"   runat="server"   ImageUrl='<%# "~/ImageHandler.ashx?MaxHeight=500&MaxWidth=500&AttachmentId=" + Eval("ATTACHMENTID") %>' Height="300px" Width="300px" />
                &nbsp;<br />
                <span  style="width:300px; background-color:Gray">       
          <asp:Label ID="Label1" runat="server" Text='<%# Eval("ATT_name") %>' 
             Font-Size="10pt" ForeColor="Black" Width="100%" />
           </span>
                    </td>

        </ItemTemplate>
    <LayoutTemplate>
            <table id="Table1" runat="server"  class="ListViewMainTable">
                <tr id="Tr1" runat="server">
                    <td id="Td2" runat="server">
                        <table ID="groupPlaceholderContainer" runat="server" border="1"  
                            style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <tr ID="groupPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr2" runat="server">
                </tr>
            </table>
      </LayoutTemplate>
        <GroupTemplate>
            <tr ID="itemPlaceholderContainer" runat="server">
                <td ID="itemPlaceholder" runat="server">
                </td>
            </tr>
        </GroupTemplate>
</asp:ListView>
4

1 回答 1

0

page-break-before:始终是样式,而不是类。您必须创建一个样式为 page-break-before: 的类,然后引用该类

于 2013-04-22T23:10:42.787 回答