Click here to Skip to main content
13,189,531 members (65,302 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello All,
I have one the following scenario implemented on Page
View 1
Update Pane 1 : Content Search Text Box and Search Button
Update Progress: Show the Progress process for Update Panel 1
Update Panel 2: This panel shows the result in List View with Data Pager control
Data Pager Control works for List View paging
Note: In Update Panel control I have not use any trigger

Issue: At first when click on node the search result data displays with number of pages.
When click on page 2 first time only, Page get post back but only the query string value is updated
But the data is not get refresh
When again click on the same page Page2 second time, the data get refresh and the query string value is updated

Note: It brings all the data and store it in session and then after showing the paging data base on that and searching. It’s a existing logic and we have to solve the issue with the change in this logic
 <asp:UpdatePanel runat="server" ID="uppEvent2" UpdateMode="Conditional">
           <div id="listview">
                <asp:ListView runat="server" ID="lstvEventDisplays" ItemPlaceholderID="pnLayout" OnItemDataBound="lstvEventDisplays_OnItemDataBound" OnPagePropertiesChanging="lstvEventDisplays_OnPagePropertiesChanging">
                <div style="margin-removed 40px; margin-removed 60px">
                   <div style="margin-removed 330px">
                      <asp:DataPager runat="server" ID="dataPagerNumeric" PagedControlID="lstvEventDisplays" PageSize="4" OnPreRender="dataPagerNumeric_OnPreRender" QueryStringField="pageId">
                              <asp:NumericPagerField ButtonType="Link" ButtonCount="10" NumericButtonCssClass="Paging" CurrentPageLabelCssClass="currentPageLabel" NextPreviousButtonCssClass="NumPaging" />

One more point i notice, In Page load i always get the value of Page.IsPostBack as false, when the page load condition is if (!Page.IsPostBack) is always executed on every postback,
Can any one tell me why this issue come for the above scenario.

Waiting for reply,
Thank you
Posted 20-Dec-12 20:27pm
Updated 20-Dec-12 21:44pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use Trigger
        <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

.aspx page Follow Following Steps
3.<b>Trigger AsyncPostBackTrigger of Update panel</b>
4. Use OnPagePropertiesChanged Event  to Bind Listview with trigger EventName and Bind Listview on this event
//Script Manager
<asp:ScriptManager ID="SM_Listview" runat="server">
 <asp:UpdatePanel ID="Listview_PagingUPanel" runat="server">
<asp:ListView ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemCommand" OnPagePropertiesChanged="lv_PagePropertiesChanged">
<asp:DataPager ID="datapagerForListview" runat="server" PagedControlID="Repeater1" PageSize="2">
  <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="true" ShowNextPageButton="false"
ShowPreviousPageButton="false" FirstPageText="First" />
<asp:NumericPagerField  ButtonType="Link" />
<asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="true" ShowNextPageButton="false"
  ShowPreviousPageButton="false" LastPageText="Last" />


<asp:AsyncPostBackTrigger ControlID="Repeater1" EventName="PagePropertiesChanged"/>
//UpdatePanel Ended

In .aspx.cs….BindRepeater on "onPagePropertiesChanged"
protected void ListView1_PagePropertiesChanged(object sender, EventArgs e)

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171016.2 | Last Updated 21 Sep 2013
Copyright © CodeProject, 1999-2017
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