Beispiel #1
0
        protected void DataList1_DeleteCommand(object sender, DataListCommandEventArgs e)
        {
            NewsArticleBLL newsarticlebll2 = new NewsArticleBLL();;
            string         id = e.CommandArgument.ToString();

            if (newsarticlebll2.Delete(id))
            {
                Response.Write("<script>alert('删除成功');</script>");
            }
            this.Response.Redirect(this.Request.Url.ToString());
        }
Beispiel #2
0
 protected void Delete_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < DataList1.Items.Count; i++)
     {
         if (((CheckBox)DataList1.Items[i].FindControl("selected")).Checked == true)
         {
             object         s = ((System.Web.UI.WebControls.HyperLink)DataList1.Items[i].FindControl("Hyperlink3")).Text;
             NewsArticleBLL NewsArticleBLL = new NewsArticleBLL();
             if (NewsArticleBLL.Delete(s))
             {
                 Response.Write("<script>alert('删除成功');</script>");
             }
         }
     }
     this.Response.Redirect(this.Request.Url.ToString());
 }