Click here to Skip to main content
15,939,736 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 20-Dec-12 21:44pm

Use Trigger

        <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />

Share this answer
.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)
Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900