2011-04-08 28 views

回答

1

您可以添加JavaScript以在點擊事件觸發時禁用按鈕。

MyButton.Attributes.Add("onclick", "this.disabled=true;" + Page.ClientScript.GetPostBackEventReference(MyButton, "").ToString()); 

代碼來自:http://weblogs.asp.net/jeffwids/archive/2009/10/06/how-to-disable-an-asp-net-button-when-clicked.aspx

+0

它不運行單擊事件,Save_Button.Attributes.Add(「onclick」,「this.disabled = true;」+ Page.ClientScript.GetPostBackEventReference(this.Save_Button ,「」).ToString()); – Jo0o0 2011-04-08 02:02:32

+0

你能發佈你看到的頁面源代碼中的按鈕嗎?關鍵是,第一個「點擊」應該禁用使用JavaScript的按鈕。這是否發生?在第二次點擊之前有沒有機會讓頁面更新? – 2011-04-08 13:09:07

+0

我發表整個源碼 – Jo0o0 2011-04-11 01:20:53