简体   繁体   中英

How do i get the parameter passed in _dopostback() in endrequest method?

How to I get the parameter value passed in

_dopostback('','');

For Example
__doPostBack('<%=upSubAccount.ClientID %>',true);
I want to get the second parameter in endrequest() handler, here

//wire the End Request process,

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(requestComplete_Handler)

    //will be called after the async request completes.
    function requestComplete_Handler(sender, args)
    {
        var panel = sender._postBackSettings.sourceElement.id;
        switch (panel)
        {
            case "<%=upSubAccount.ClientID %>":
                __doPostBack('<%=upAllocationChart.ClientID %>');
                break;
        }
    }

The second argument is the event argument.
It is not stored by the framework.
However you can easily store it in a variable of your own and access it later.
You only need to replace the __doPostBack with your own function.

var orignalDoPostback = __doPostBack;
var lastEventArgument = "";
__doPostBack = function(eventTarget, eventArgument)
{
   lastEventArgument = eventArgument;
   orignalDoPostback(eventTarget, eventArgument);
}

Then you can use it as required.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM