CODEDIGEST
Home » CodeDigest
Search
 

Technologies
 

Get the Element that raised the Asynchronous Postback in UpdatePanel uisng JavaScript in ASP.Net AJAX
Submitted By Satheesh Babu B
On 2/9/2009 9:18:52 AM
Tags: ASP.Net AJAX,CodeDigest  

Get the Element that Raised the Asynchronous Postback using UpdatePanel in JavaScript in ASP.Net AJAX

In ASP.Net AJAX applications, we may get a situation where we need to get the element that raised the AJAX postback from UpdatePanel using JavaScript.

 

It is possible to get the element that raised the Asynchronous postback from OnInitializeRequest event of PageRequestManager class in client side.

 

The below code snippet will help us to do the same.

 

<script language="JavaScript">   

function pageLoad()

    {

       Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(OnInitializeRequest);    

    }

 function OnInitializeRequest(sender, args)

    {

   alert(args.get_postBackElement().id);

    }  

 </script>

 

Do you have a working code that can be used by anyone? Submit it here. It may help someone in the community!!

Recent Codes
  • View All Codes..