Monday, March 26, 2012

catching the postBacks of UserControl inside another UserControl

My problem is that i've got:

MasterPage with a Menu, ScriptManager and a UpdatePanel, inside of wich i've put the the ContentPlaceHolder. I've put the Menu as trigger for the UpdatePanel

In the ContentPage i want to show, i have a UserControl that has inside of itself another UserControl.

Even putting an UpdatePanel in the ContentPage containing the UserControl (Parent), the whole page refreshes instead of been only the ContentPage, due to the UpdatePanel of the MasterPage.

All the UpdatePanels have de UpdateMode as Conditional.

How can i make this work, refreshing only the contentPage or the area pretended of the contentPage?

i've seen other Posts, but they only talk of one UserControl.

Thanks a lot.

You've got two problems:

First, the menu control is not compatible with partial-page updates and therefore not compatible with updatepanel controls.

Second, if you are using a master page, you are going to get a full refreshevery time you load a content page. When you navigate to a content page, you are not just reloading the part of the page that is in the contentplaceholder. You are loading anentire page that is a meshing of the master and content page. So what you are trying to do is not possible. Placing an updatepanel around a contentplaceholder does nothing. Different page = refresh.


thanks for your answer, but what i meant was the case of the usercontrols. the use of them makes me refresh the whole page, even though the content page is inside a update panel, i've tried to put the control inside a updatepanel conditional mode, but it still doesn't work.

this usercontrol was another one inside itself.


See if this article helps:

http://asp.net/ajax/documentation/live/tutorials/UsingUpdatePanelUserControls.aspx

No comments:

Post a Comment