ASP.NET validation controls to prevent double click send button

ASP.NET validation controls to prevent double click send button


Recently on the network see a good article ...

introduces ASP.NET validation controls to prevent the use of double click send button issue

in this way for everyone to share this article ....

Source: http : //www.ithome.com.tw/plog/index.php op = ViewArticle & articleId = 11012 & blogId = 418?


brother also did a test ... the following example:

c # example

.aspx

01 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="doubleClick.aspx.cs" Inherits="doubleClick" %>
02
03
04
05
06     未命名页面
07
08
09    

10        

11             12 runat = "server" ControlToValidate = "TextBox1" ErrorMessage = " non-blank">

13            

14    

15
16
17
18
32
33


.cs

01 using ...System;
02 using System.Data;
03 using System.Configuration;
04 using System.Collections;
05 using System.Web;
06 using System.Web.Security;
07 using System.Web.UI;
08 using System.Web.UI.WebControls;
09 using System.Web.UI.WebControls.WebParts;
10 using System.Web.UI.HtmlControls;
11
12 public partial class doubleClick : System.Web.UI.Page
13 ...{
14     protected void Page_Load(object sender, EventArgs e)
15     ...{
16         this.Button1.Attributes.Add("onclick", "check(this);");
17     }
18     protected void Button1_Click(object sender, EventArgs e)
19     ...{
// save the simulation database 20, the processing time of 5 seconds
21 is System.Threading.Thread.Sleep (5000);
22 is Response.Write (this.TextBox1.Text);
23 is}
24}

Original: Big Box  ASP.NET validation controls to prevent double click send button


Guess you like

Origin www.cnblogs.com/petewell/p/11516593.html