How to get Id update panel that initial a request in javascript

前端 未结 1 555
长情又很酷
长情又很酷 2021-01-15 04:20

I want to know Id update panel that initial a request in JavaScript .I write this script but it return undefined.

var prm = Sys.WebForms.PageRe         


        
相关标签:
1条回答
  • 2021-01-15 04:43

    You can use the get_updatePanelsToUpdate that return an array with the Ids of the UpdatePanels that will be going to updated.

    <script>
        window.onload = function() {
            var prm = Sys.WebForms.PageRequestManager.getInstance();
    
            prm.add_initializeRequest(InitializeRequest);
            prm.add_endRequest(EndRequest);
        };
    
          function InitializeRequest(sender, args) 
          {     
             // get the array of update panels id
             var UpdPanelsIds = args.get_updatePanelsToUpdate();
             // get the Post ID
             args.get_postBackElement().id;
          }
    
          function EndRequest(sender, args) {
          }
    </script>
    

    http://msdn.microsoft.com/en-us/library/ee224805.aspx

    0 讨论(0)
提交回复
热议问题