UserStatue.aspx.cs
上传用户:tjxpgg
上传日期:2017-05-14
资源大小:2244k
文件大小:1k
源码类别:

SilverLight

开发平台:

ASP/ASPX

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. public partial class UserStatue : System.Web.UI.Page
  12. {
  13.     protected void Page_Load(object sender, EventArgs e)
  14.     {
  15.         if (!IsPostBack)
  16.         {
  17.             this.GridView1.DataSource=DBHelp.Select("select * from users");
  18.             this.GridView1.DataBind();
  19.         }
  20.     }
  21.     protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
  22.     {
  23.         string id = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
  24.         if (DBHelp.Update("delete from users where id=" + id + ""))
  25.         {
  26.             this.GridView1.DataSource = DBHelp.Select("select * from users");
  27.             this.GridView1.DataBind();
  28.         }
  29.     }
  30. }