anouar.bagari
anouar.bagari

Reputation: 2104

asp.net ajax beginrequest

I'm creating an asp.net application and I need to get the name of the control who initiated an asynchronous post pack from a beginRequestHandler.

Here is my code:

<script type="text/javascript">
    function pageLoad(sender, args) {
        Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginAjaxRequest);
    }

    function beginAjaxRequest(sender, args) {
       // do work here
    }

</script>

Upvotes: 1

Views: 1879

Answers (1)

Pranay Rana
Pranay Rana

Reputation: 176896

To get the postbackelement

function BeginRequestHandler(sender, args)
{
     var elem = args.get_postBackElement();
     alert(args.get_postBackElement().id);
}

Upvotes: 1

Related Questions