首页 > JS --正则表达式验证、实战之邮箱模式

JS --正则表达式验证、实战之邮箱模式

JS验证格式:提高用户体验,验证文本。

需要防止程序员的代码结构更改攻击,因为web段的代码有可能会被更改,更改后JS有可能会验证不住

那么,C#端在JS段通过验证的情况下,还需要进行二次验证

"form1" runat="server">"TextBox1" runat="server">"Label1" runat="server" Text="Label">"Button1" runat="server" Text="Button" />
View Code
    

邮箱:

"form1" runat="server">"Repeater1" runat="server">"tb1">"tr_head">class="tr_item">
"checkbox" id="ck_all" />用户名密码昵称性别生日民族
"checkbox" class="ck" name="ckk" value="<%#Eval("UserName") %>" /><%#Eval("UserName") %><%#Eval("PassWord") %><%#Eval("NickName") %><%#Eval("SexStr") %><%#Eval("BirthdayStr") %><%#Eval("NationName") %>
"Button1" runat="server" Text="Button" />"Label1" runat="server" Text="Label">
View Code

 

 
"form1" runat="server">"Repeater1" runat="server">"tb1">"tr_head">class="tr_item">
"checkbox"id="ck_all" />用户名 密码 昵称 性别 生日 民族
"checkbox" class="ck" name="ckk" value="<%#Eval("UserName") %>" /> <%#Eval("UserName") %><%#Eval("PassWord") %><%#Eval("NickName") %><%#Eval("Ssex") %><%#Eval("Birthday2") %><%#Eval("Nation") %>
"Button1" runat="server" Text="Button" />"Label1" runat="server" Text="Label">

 

    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();//删完再重新绑定}

 

转载于:https://www.cnblogs.com/yp11/p/5913270.html

更多相关: