I have a page associated with master page. I need to implement the Ajax(basically wanted to to do partial page refresh).
In this page I have grid and paging buttons(first/previous/last/next), dropdowns and also search.
So all these updates the grid.
Right now I have below code
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
under
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
Here is the html like grid/buttons/search after ContentTemplate tag starts
So finally the page has left menu/footer/header and contents
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
But this is still refreshing the page.
I am a little confused as to you have and what you want.
It sounds like you have a
Contentcontrol with anUpdatePanelin it. Within theUpdatePanelContentTemplateyou have all your grid, buttons etc along with your menu.You only need to have the controls that you want to do the refresh in your
UpdatePanelContentTemplate. All the other stuff you should have outside of theUpdatePanel. If you have any controls outside of theUpdatePanelthat you need to trigger a refresh with setup aTriggerfor each control in theUpdatePaneland tell it which event to trigger off of.Example:
In the above example the
btnTestclick event will cause the content of theUpdatePanelto refresh but theButtonor anything outside of theUpdatePanelwill not refresh. If theTriggerwas not setup, the whole page would refresh. You don’t needTriggersetup for controls within anUpdatePanelas all control events will be captured by theUpdatePanelfor a refresh.You can read up more on MSDN.