在 ASP.NET 1.0 時..
要在 Page_Load 中寫
Me.ButtonAddBack.Attributes("onclick") = "this.disabled = true;" & GetPostBackEventReference(ButtonAddBack).ToString
this.disabled=true; 是為了將按鈕反白無法啟用
後面加上 GetPostBackEventReference 是因為在 disabled 後不會執行 PostBack 動作,
所以要用GetPostBackEventReference(ButtonAddBack) 來模擬 PostBack
----
在 ASP.NET 2.0 時...
可以在 Button 的 OnClientClick 直按寫上 this.disabled = true;
再把 UseSubmitBehavior 屬性設為 false 就可以了

沒有留言:
張貼留言