Click here to Skip to main content
15,884,744 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
My master page contains web form. And web form contains user control.
User control contains combobox within UpdatePanel.
When selectedindexchange event of combobox fired, I want to fire a method at MasterPage (Client side or Server side).
Is that possible.
I added following lines of code at MasterPage.Master. But it does not work.
Breakpoint at Onload event from MasterPage was hit.

HTML
<script type="text/javascript">
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
    function EndRequestHandler(sender, args) {
        alert('partial postback');
    }
</script>

Is there a way?
Posted

1 solution

Hi,

It is possible. you can create delegate that will call master page function from the user control

hope you find the way... :)
 
Share this answer
 
Comments
tslin89 26-Nov-12 2:17am    
Ok. Let me try. Thanks for your answer :)
AmitGajjar 26-Nov-12 2:58am    
Your welcome.
tslin89 26-Nov-12 22:59pm    
hi again!
How to implement a delegate method for this situation? Or event?
I need to call a method from MasterPage everytime user control is post back, right?
Could you show me some sample code?
AmitGajjar 26-Nov-12 23:28pm    
check http://stackoverflow.com/questions/6192739/how-do-i-raise-an-event-in-a-usercontrol-and-catch-it-in-mainpage discussion. you will find your answer there...
tslin89 27-Nov-12 0:22am    
Thanks again :)

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