protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { bind(); } string listbookkeepid; if (!IsPostBack) { try { if (Request.QueryString["list_book_keep_id"] != null) { listbookkeepid = Request.QueryString["list_book_keep_id"].ToString(); List_book_keepManager.delete(listbookkeepid); Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('删除成功!');</script>"); } } catch (Exception ex) { Response.Write("错误原因:" + ex.Message); } BingLS(); bind(); } BingLS(); }
protected void Button1_Click(object sender, EventArgs e) { Button bt = (Button)sender; if (Session["user_name"] != null) { try { List_book_keep lbk3 = new List_book_keep(); lbk3.Lbk_list_name1 = DropDownList1.SelectedValue; lbk3.Lbk_book_id1 = int.Parse(Request.QueryString["book_id"].ToString()); if (List_book_keepManager.sctuchu(lbk3) == 1) { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('收藏成功');</script>"); } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('收藏失败');</script>"); } } catch (Exception ex) { Response.Write("错误原因:" + ex.Message); } } else { Page.ClientScript.RegisterClientScriptBlock(typeof(Object), "alert", "<script>alert('请先登录!');</script>"); } }
protected void BingLS() { string list1_name = Request.QueryString["list1_name"].ToString(); DataTable lx = List_book_keepManager.listtushu(list1_name); if (lx != null) { ListView1.DataSource = lx; ListView1.DataBind(); } }