datalist内嵌与递归的前台代码

来源:互联网 发布:2016淘宝联盟导购推广 编辑:程序博客网 时间:2024/05/29 09:55

 <%@ Control Language="C#" AutoEventWireup="true" CodeFile="UCUserReview.ascx.cs" Inherits="Web_UC_UCUserReview" %>
<asp:DataList ID="dl1" runat="server" DataKeyField="URID" OnItemDataBound="dl1_ItemDataBound" OnItemCommand="dl1_ItemCommand" Width="399px">
    <ItemTemplate>
    <asp:Panel ID="pMain" runat="server" >
        <table>
            <tr>
                <td align="left" rowspan="2" style="width: 100px; height: 71px;">
                    <asp:Image ID="ImgUHeadPicture" runat="server" ImageUrl='<%#"~//Photos//"+FindUHeadPic(Eval("UID")) %>' Height="50px" Width="50px" /><br />
                    <asp:Label ID="labUName" runat="server" Text='<%#FindUNickName(Eval("UID")) %>'></asp:Label></td>
                <td style="width: 100px; height: 71px;" align="left">
                    <asp:Label ID="Label2" runat="server" Text='<%#Eval("URContent") %>' Width="100%"></asp:Label><br />
                </td>
            </tr>
        </table>
   </asp:Panel>
        <table style="text-align: right; width:100%">
            <tr>
                <td align="right">
                    <asp:HiddenField ID="HiddenField1" runat="server" Visible="False" />
                    <asp:Button ID="btnResponsed" runat="server"  Text="回复" CommandName="Click" /></td>
            </tr>
        </table>
         <asp:Panel ID="pResponsed" runat="server" Height="66px" Visible="False" Width="231px">
            <asp:TextBox ID="txtContent" runat="server" Height="100px" Width="100%"></asp:TextBox>
            <asp:Button ID="btnAdd" runat="server" Text="发表" CommandName="Confirm" />
            <asp:Button ID="btnReset" runat="server" Text="重置" CommandName="ReSet" />
        </asp:Panel>
    </ItemTemplate>
</asp:DataList>
<asp:Label ID="labCount" runat="server" Text="共"></asp:Label>
<asp:Label ID="labCounter" runat="server" Text="0"></asp:Label>
<asp:Label ID="labpage" runat="server" Text="页"></asp:Label>
<asp:Label ID="labIndex" runat="server" Visible="False"></asp:Label>
<asp:DropDownList ID="ddlCount" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCount_SelectedIndexChanged">
</asp:DropDownList>
<asp:Button ID="btnIndex" runat="server" OnClick="btnIndex_Click" Text="首页" />
<asp:Button ID="btnUp" runat="server" OnClick="btnUp_Click" Text="上一页" />
<asp:Button ID="btnNext" runat="server" OnClick="btnNext_Click" Text="下一页" />
<asp:Button ID="btnEnd" runat="server" OnClick="btnEnd_Click" Text="尾页" /><br />
我要留言<br />
<asp:Label ID="labContent" runat="server" Text="留言内容"></asp:Label>
<asp:TextBox ID="txtContent" runat="server" Height="74px" Width="337px"></asp:TextBox><br />
<table>
    <tr>
        <td align="right" style="width: 400px">
            <asp:Label ID="labMessage" runat="server" ForeColor="Red"></asp:Label>
            <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="发表留言" />
            <asp:Button ID="btnReSet" runat="server" Text="重置" /></td>
    </tr>
</table>

原创粉丝点击