做爰高潮a片〈毛片〉,尤物av天堂一区二区在线观看,一本久久A久久精品VR综合,添女人荫蒂全部过程av

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

ASP.NET 多次提交的解決辦法2

來源:懂視網 責編:小采 時間:2020-11-27 22:44:42
文檔

ASP.NET 多次提交的解決辦法2

ASP.NET 多次提交的解決辦法2:例如: protected void Page_Load(object sender, EventArgs e) { //.net1.1 Button1.Attributes.Add(onclick, this.disabled=true; + this.GetPostBackEventReference(this.Button1)); //.n
推薦度:
導讀ASP.NET 多次提交的解決辦法2:例如: protected void Page_Load(object sender, EventArgs e) { //.net1.1 Button1.Attributes.Add(onclick, this.disabled=true; + this.GetPostBackEventReference(this.Button1)); //.n

例如:
protected void Page_Load(object sender, EventArgs e)
{
//.net1.1
Button1.Attributes.Add("onclick", "this.disabled=true;" + this.GetPostBackEventReference(this.Button1));
//.net 2.0以上
Button1.Attributes.Add("onclick", "this.disabled=true;" + this.ClientScript.GetPostBackEventReference(Button1, ""));
}
為了測試,我們可以建立一個頁面,加入一個btnAdd按鈕
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddAndEditUser.aspx.cs" Inherits="AddUser" %><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>添加和編輯頁面示例</title>
</head>
<body>
<form id="frmMain" runat="server">
<asp:Button ID="btnAdd" runat="server" CssClass="INPUT-BUTTON-Save" OnClick="btnAdd_Click">
</asp:Button>
</form>
</body>
</html>
/*----------------------------------------------------------------
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class AddUser : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
btnAdd.Attributes.Add("onclick", "this.disabled=true;" + this.ClientScript.GetPostBackEventReference(btnAdd, ""));
}
protected void btnAdd_Click(object sender, EventArgs e)
{
//模擬網絡擁塞5秒鐘
System.Threading.Thread.Sleep(5000);
}
}
可見當點擊了按鈕,需要等5秒鐘按鈕才能點擊。即頁面回發(fā)一后按鈕才能用。這樣可以有效的防止用戶多次點擊按鈕,造成多次提交!

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

文檔

ASP.NET 多次提交的解決辦法2

ASP.NET 多次提交的解決辦法2:例如: protected void Page_Load(object sender, EventArgs e) { //.net1.1 Button1.Attributes.Add(onclick, this.disabled=true; + this.GetPostBackEventReference(this.Button1)); //.n
推薦度:
  • 熱門焦點

最新推薦

猜你喜歡

熱門推薦

專題
Top
主站蜘蛛池模板: 闵行区| 巨野县| 苗栗县| 淮南市| 扎鲁特旗| 朔州市| 孝昌县| 朝阳市| 梧州市| 子洲县| 辽中县| 德州市| 灵山县| 舞钢市| 新邵县| 什邡市| 宣汉县| 祁阳县| 雷山县| 邵阳县| 扎兰屯市| 天镇县| 门头沟区| 北京市| 临高县| 高唐县| 永宁县| 普宁市| 扎鲁特旗| 都匀市| 黔南| 大英县| 噶尔县| 凉城县| 永靖县| 黔西| 连云港市| 西盟| 佛教| 景洪市| 鄄城县|