需要防止程序员的代码结构更改攻击,因为web段的代码有可能会被更改,更改后JS有可能会验证不住
那么,C#端在JS段通过验证的情况下,还需要进行二次验证
邮箱:
protected void Page_Load(object sender, EventArgs e){if (!IsPostBack){Repeater1.DataSource = new UsersDA().Select();Repeater1.DataBind();}Button1.Click += Button1_Click;}void Button1_Click(object sender, EventArgs e){Label1.Text = Request["ckk"].ToString();//点击按钮取出主键值。string[] unames = Request["ckk"].ToString().Split(',');//分隔foreach (string s in unames)//遍历所选的{new UsersDA().Delete(s);}Repeater1.DataSource = new UsersDA().Select();Repeater1.DataBind();//删完再重新绑定}