The submission of the situation of friends can refer to, I hope to help you
The method can be loaded on the server side:
Copy Code code as follows:
private void onloading ()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder ();
sb. Append ("function pageload () {var manager = Sys.WebForms.PageRequestManager.getInstance ();");
sb. Append ("Manager.add_beginrequest" (onbeginrequest); Manager.add_endrequest (Onendrequest)} var Lcpostbackelementid; ");
sb. Append ("function OnBeginRequest" (sender, args) {Lcpostbackelementid = Args.get_postbackelement (). Id.tolowercase (); if (Lcpostbackelementid = = "Btnadwords") {$get ("btnadwords"). Disabled = true; $get ("Btnadwords"). Value= ' Submitting ... '} ");
sb. Append ("function Onendrequest" (sender, args) {if (Lcpostbackelementid = = "Btnadwords") {$get ("btnadwords"). Disabled = False $get ("Btnadwords"). value= ' OK ';} ");
Scriptmanager.registerstartupscript (Page, Page.gettype (), "Btnadwords", sb. ToString (), true);
}
can also be written directly in the page script:
Copy Code code as follows:
<script>
function pageload ()
{
var manager = Sys.WebForms.PageRequestManager.getInstance ();
manager.add_beginrequest (onbeginrequest);
manager.add_endrequest (onendrequest)
}
var Lcpostbackelementid;
function OnBeginRequest (sender, args)
{
Lcpostbackelementid = Args.get_postbackelement (). Id.tolowercase ();
if (Lcpostbackelementid = = ' Btnadwords ')
{
$get (' btnadwords '). Disabled = true;
$get (' btnadwords '). Value= ' is submitting ... ';
}
}
function Onendrequest (sender, args)
{
if (Lcpostbackelementid = = "Btnadwords")
{
$get (' btnadwords '). Disabled = false;
$get (' btnadwords '). value= ' OK ';
}
}
</script>
For more information please refer to: http://msdn.microsoft.com/zh-cn/magazine/cc163319.aspx