Click here to Skip to main content
11,708,312 members (75,739 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET partial Masterpage , +
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.

<script type="text/javascript">
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
    function EndRequestHandler(sender, args) {
        alert('partial postback');
    }
</script>
Is there a way?
Posted 25-Nov-12 16:44pm
tslin89796

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,

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

hope you find the way... Smile | :)
  Permalink  
Comments
TSLin306 at 26-Nov-12 2:17am
   
Ok. Let me try. Thanks for your answer :)
@AmitGajjar at 26-Nov-12 2:58am
   
Your welcome.
TSLin306 at 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 at 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...
TSLin306 at 27-Nov-12 0:22am
   
Thanks again :)
@AmitGajjar at 27-Nov-12 1:12am
   
Your welcome

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

  Print Answers RSS
0 Maciej Los 245
1 Sergey Alexandrovich Kryukov 189
2 Mika Wendelius 180
3 Peter Leow 130
4 OriginalGriff 103
0 OriginalGriff 9,253
1 Sergey Alexandrovich Kryukov 8,562
2 CPallini 5,189
3 Maciej Los 4,966
4 Mika Wendelius 3,856


Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100