Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I realise you can get the postbackelement of the ajax call request:

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
    var elem = args.get_postBackElement();


Does anyone know if I can get the server side event it's trying to call also?

What I'm trying to acheive (might make more sense):

I have 2 update panels on a page, updatepanel1 has a gridview and the property 'ChildrenAsTriggers' set to false. UpdatePanel2 has been put in a hidden floating div (looks like a modal popup) and it's trigger has been set to GridView1.SelectedIndexChanged. I capture the element in PageRequestManager (beginrequest) and if it's the GridView then I show the div containing updatepanel2.

This is all working great until I want to allow sorting on the GridView which obviously shows updatepanel2 when I don't want it to. I need to somehow do:

function BeginRequestHandler(sender, args) {
    var elem = args.get_postBackElement();
    if (elem is GridView1 and event being called is selectedindexchanged)


However can not seem to easily find which event is being called.

Any help would be appreciated. Thanks

Gav
Posted
Updated 19-May-10 22:58pm
v2

1 solution

Perhaps not the most elegant way but I've managed to acheive my goal by using:

document.getElementById("__EVENTARGUMENT").value.indexOf("Select$")!=-1


Still open to suggestions if there is a different/better way?!
Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900