[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5086
  • Last Modified:

Whole page refresh on PostBack from UpdatePanel

I have seen numerous posts on solutions to whole-page refresh from postback from within an Ajax UpdatePanel. Most are relatively simplistic and don't address the issue that I face.

I have a number of nested UpdatePanels within a control tree which is built dynamically. It looks roughly like the code fragment below. Both header and footer work fine with custom postbacks from buttons etc using GetPostBackEventReference working fine and refreshing only the relevant panel.

The cause of my woes is the middle Body panel which contains a customised GridView. Here some columns are templated with buttons within them using ITemplate, InstantiateIn etc. The mechanism works fine except that postback causes whole page refresh.

Is the issue here to do with dynamic changes to the control tree, is it something to do with GridView and templated columns or does it lie somewhere else?

<asp:UpdatePanel
  ID="VwrUpdPnl"
  RenderMode="Block"
  UpdateMode="Conditional"
  EnableViewState="false"
  runat="server">
    <ContentTemplate>
      ....
      <%--Header Update Panel--%>
      <asp:UpdatePanel
        ID="HdrUpdPnl"
        RenderMode="Block"
        UpdateMode="Conditional"
        EnableViewState="false"
        runat="server">
          <ContentTemplate>
          ...
          </ContentTemplate>
      </asp:UpdatePanel>
      ...
      <%--Body Update Panel--%>
      <asp:UpdatePanel
        ID="HdrUpdPnl"
        RenderMode="Block"
        UpdateMode="Conditional"
        EnableViewState="false"
        runat="server">
          <ContentTemplate>
          ...
          </ContentTemplate>
      </asp:UpdatePanel>
      ...
      <%--Footer Update Panel--%>
      <asp:UpdatePanel
        ID="HdrUpdPnl"
        RenderMode="Block"
        UpdateMode="Conditional"
        EnableViewState="false"
        runat="server">
          <ContentTemplate>
          ...
          </ContentTemplate>
      </asp:UpdatePanel>
    ...
    </ContentTemplate>
</asp:UpdatePanel>

0
Sunningwell
Asked:
Sunningwell
1 Solution
 
REA_ANDREWCommented:
Create an async trigger on one of your update panels and point to the controlid of your gridview and use the event type as Command. That way you can handle your gridview when it fires the command event

Andrew
0
 
SunningwellAuthor Commented:
Thanks. I'll try and will get back.
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now