0

I have this code in my aspx page:

<form id="form2" runat="server">
  <asp:ScriptManager ID="ItemsScriptManager" runat="server" EnablePartialRendering="true" />
  <asp:Button runat="server" ID="SearchButton" OnClick="ItemsSearch" Text="Search" />
  <asp:UpdatePanel runat="server" ID="ItemsUpdatePanel">
    <ContentTemplate>
      <asp:ObjectDataSource runat="server" ID="ItemsDS"
        TypeName="TemplateGridViewODSPagingSorting.ItemDAO" SelectMethod="GetItems" />
      <asp:GridView runat="server" ID="ItemsGridView" DataSourceID="ItemsDS"
        AllowPaging="true" AllowSorting="true" PageSize="4">
      </asp:GridView>
    </ContentTemplate>
  </asp:UpdatePanel>
</form>

By pressing on another page of the GridView the Page_Load is triggered, is this normal behavior for a partial postback?

Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169

2 Answers2

1

Partial rendering using UpdatePanel does not change or affect the whole Page life cycle in ASP.NET.

it's a small trick used to re-render only a certain region of the page in the browser (the UpdatePanel) but nothing else change, so yes, it's normal to see Page_Load and all other events to be triggered as usual; it has to be like that or it would not work :)

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
1

Yes, the during update panel update, the page_load will be called with every asynchronous postback to the server, to overcome this, you can use jquery ajax.

Samir Adel
  • 2,691
  • 2
  • 15
  • 16