Recently encountered a problem: the page uses Ajax, not jquery, and uses Microsoft scriptmanager and updateprogress. How does one prohibit repeated submission during data return? That is, after you click the submit button, the button cannot be used. After the data is returned, the button status automatically becomes available!
I went to the Microsoft forum to ask, and the experts gave the answer. After testing, the following method is feasible!
Front-end page:
<Form ID = "form1" runat = "server">
<Asp: scriptmanager id = "scriptmanager1" runat = "server"/>
<Asp: updatepanel runat = "server" id = "updatepanel1">
<Contenttemplate>
<Asp: button text = "Submit" id = "btn_go" runat = "server" onclick = "btn_go_click"/>
</Contenttemplate>
</ASP: updatepanel>
<Asp: updateprogress id = "updateprogress1" runat = "server" associatedupdatepanelid = "updatepanel1">
<Progresstemplate>
processing ......
</Progresstemplate>
</ASP: updateprogress>
</Form>
Background code:
Protected void page_load (Object sender, eventargs E)
{
Scriptmanager. registeronsubmitstatement (page, typeof (PAGE), "go_disabled", "document. getelementbyid ('btn _ go '). Disabled = 'Disabled ';");
Scriptmanager. registerstartupscript (page, typeof (PAGE), "clear_disabled", "document. getelementbyid ('btn _ go'). Disabled =''; ", true );
}
Protected void btn_go_click (Object sender, eventargs E)
{
System. Threading. thread. Sleep (3000); // simulate a task
// For (long I = 1; I <1000000000; I ++ );
Btn_go.text = "execute complete ";
}