前台按鈕:
<ASP:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" OnClIEntClick="this.form.submit();this.disabled=true" UseSubmitBehavior="False" />
後台代碼:
protected void Page_Load( object sender, EventArgs e )
{
if (Page.IsPostBack)
{
Button1.Attributes.Add("disabled", "disabled");
}
}
關鍵是紅色部分OnClIEntClick="this.form.submit();this.disabled=true" UseSubmitBehavior="False" 。