Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8521599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:52:25+00:00 2026-06-11T06:52:25+00:00

When i change the page in datapager it causes full postback, even the datapager

  • 0

When i change the page in datapager it causes full postback, even the datapager is working very abnormally, idont know what is the reason. by abnormaaly i mean sometime data is shown sometime doesnt,
Following is th my code in c#

     protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindListView();
        }           
    }

    protected void StudentListView_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        BindListView();
    }
    private void BindListView()
    {
        StudentListView.DataSource = StudentDataSource;
        StudentListView.DataBind();
    }

    protected void StudentDataSource_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        e.Arguments.MaximumRows = StudentListDataPager.MaximumRows;
        e.Arguments.StartRowIndex = StudentListDataPager.StartRowIndex;
    }

Following is my markup

    <asp:UpdatePanel runat="server" UpdateMode="Conditional">
    <ContentTemplate>        <
    <asp:DropDownList runat="server" ID="BatchDropDownList" AutoPostBack="True">
        <asp:ListItem Text="Batch 1" Value="1" Selected="True" />
        <asp:ListItem Text="Batch 2" Value="2" />
    </asp:DropDownList>

    <asp:ListView ID="StudentListView" runat="server"       
        ItemPlaceholderID="ListViewContent" 
            EnableViewState="false" 
            onpagepropertieschanging="StudentListView_PagePropertiesChanging"> 
        <LayoutTemplate> 
            <table style="width:100%">
                <thead>
                    <tr>
                        <th class="align-left"><strong>Name</strong></th>
                        <th class="align-left"><strong>MobNo</strong></th>
                    </tr>
                </thead>
                <tbody runat="server" id="ListViewContent"> 
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="3">

                        </td>
                    </tr>
                </tfoot>
            </table>

        </LayoutTemplate>  
        <ItemTemplate>  

            <tr>
                <td style="width:70%;"><%# Eval("FirstName") %>&nbsp<%# Eval("LastName") %></td>
                <td style="width:30%;"><%# Eval("MobNo") %></td>                    
            </tr>

        </ItemTemplate>             
    </asp:ListView>
    <asp:DataPager ID="StudentListDataPager" runat="server" PageSize="5" PagedControlID="StudentListView">
        <Fields>
            <asp:NumericPagerField />
        </Fields>
    </asp:DataPager>


    <asp:ObjectDataSource ID="StudentDataSource" runat="server" 
        SelectMethod="GetStudentListBatchWise" SelectCountMethod="StudentCount" 
            TypeName="SCERPCommonUtil.Student" EnablePaging="True" 
            onselecting="StudentDataSource_Selecting">
        <SelectParameters>
            <asp:ControlParameter Name="batchId" ControlID="BatchDropDownList" PropertyName="SelectedValue" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </ContentTemplate>
</asp:UpdatePanel>

Please tell me if i am making any mistakes.

P.S. : Please dont point me to any stackoverflow question as i have read all of them, and none is specific to my requirement,

Most important problem i am facing is that datapager is giving full postback, even if put datapager inside updatepanel same thing happens.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:52:27+00:00Added an answer on June 11, 2026 at 6:52 am

    I figured it – incase somebody come looking –

    i was using <form runat="server">...<form> tag, inside which all this listview,datapager code was present. When i assigned unique id attribute to form tag then everything started working correctly.
    Although i dont understand the reason of such behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a DataPager control, I want to change count items on each page.
How to change the .page width value below, programmatically in the code behind page?
I want to change master page some label value from child page.
I need that on every page change or on some elemetents (a, input[button, submit],
I would like to change the page names of a ASP.NET site to make
I need to redirect users to the Change Password page if their password has
I'm trying to change pageindex on page_Load event but its not working. I can
In rml reports how can i change the current page number format from page:1
I'm writing some Javascript code and I'm trying to change the current page as
I am programming via Visual Studio 2008. I change my html page and save

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.