datalist中ExtractTemplateRows的应用

        <asp:DataList ID="DataList1" runat="server" BorderWidth="1px" CellPadding="2"
        DataKeyField="qaa_id" DataSourceID="SqlDataSource1"  GridLines="Both" HorizontalAlign="Center" Width="98%"

        <asp:DataList ID="DataList1" runat="server" BorderWidth="1px" CellPadding="2"
        DataKeyField="qaa_id" DataSourceID="SqlDataSource1"  GridLines="Both" HorizontalAlign="Center" Width="98%"
        ExtractTemplateRows="True">

            <ItemTemplate>
           
            <asp:Table ID="Table1" runat="server">
                <asp:TableRow>
                    <asp:TableCell Text='<%# (Convert.ToInt32(Eval("qaa_userid"))==0)?"客服回复":"我的问题"%>’ RowSpan="2" CssClass="tdleftcol"></asp:TableCell>
                    <asp:TableCell Text='<%# Eval("qaa_content") %>’></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>  
                    <asp:TableCell Text='<%# Eval("qaa_date") %>’ CssClass="grayfont"></asp:TableCell>              
                </asp:TableRow>
            </asp:Table>

            </ItemTemplate>
    </asp:DataList>

发表评论

电子邮件地址不会被公开。 必填项已用*标注