批量更新,批量删除
DIV《=============》Pannel(Fill全局)
客户端标记 服务器端控件
CSS
Repeater控件
<asp:Repeater ID="rptContent" runat="server"
onitemcommand="rptContent_ItemCommand"gt;
<ItemTemplate>
<div class="logtop"gt;
<div class="logtitle"gt;
<%#Eval("AccountClassName") %gt;
|
<%#Eval("AccountDate") %gt;
</div>
</div>
<div class="logmiddle"gt;
<div class="logtext"gt;
<%#Eval("AccountDescription") %gt;
</div>
</div>
<div class="logbottom"gt;
<div class="logmore"gt;
<asp:LinkButton ID="LinkButton1" CommandArgument='lt;%#Eval("AccountID")%gt;' CommandName="replyAuthor" runat="server"gt;回复作者lt;/asp:LinkButtongt;
| <asp:LinkButton ID="LinkButton2" CommandArgument='lt;%#Eval("AccountID")%gt;' CommandName="deleteAuthorByid" runat="server"gt;删除lt;/asp:LinkButtongt;lt;/divgt;
</div>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
----------------------
LinkButton控件的获取:
protected void rptContent_ItemCommand(object source, RepeaterCommandEventArgs e)
{
switch(e.CommandName)
{
case "replyAuthor":
{
Response.Write(e.CommandArgument.ToString());
break;
}
case "deleteAuthorByid":
{
Account.DeleteAccount(e.CommandArgument.ToString());
DataTable dt = Account.QueryAtAtClass();
this.rptContent.DataSource = dt;
this.rptContent.DataBind();
break;
}
}
}
----------------------------------------------
浙公网安备 33010602011771号