日期:2014-05-17 浏览次数:20450 次
<asp:DataList ID="DataList1" runat="server" RepeatColumns="2">
<ItemTemplate>
<asp:LinkButton ID="lkbImg" runat="server">
<img src='/Student/UpSmallPhoto/<%# Eval("Photo_Path")%>' style="border-width:0px" width="133px" height="100px"/>
</asp:LinkButton>
<asp:LinkButton ID="pass" style="text-decoration:none;color:#ff0000;" runat="server" Text="审核通过" OnClick="pass_Click"/>
</ItemTemplate>
</asp:DataList>
protected void pass_Click(object sender, EventArgs e)
{
string passSql = "update Stu_Work set Pass='1' where Work_ID='" + DataList1.DataKeys[e.Item.ItemIndex].ToString() + "'";
bool del = mydata.ExceSQL(passSql);
if (del)
{
Response.Write("<script language=javascript>alert('通过审核');</script>");
}
}
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
Literal ID = (Literal)e.Item.FindControl("ltID");
switch (e.CommandName)
{
case "Approve":
Response.Write(e.Item.ItemIndex);