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 8387685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:16:53+00:00 2026-06-09T18:16:53+00:00

I have a Tab Control that contains a ListView, there are three Tabs, each

  • 0

I have a Tab Control that contains a ListView, there are three Tabs, each tab contains the same ListView but the Data Source is changed whenever the tab chagnes.

Lets say there are 3 Tabs:
Tab1: Customers
Tab2: Items
Tab3: Orders

The problem comes when I use a DataPager. (Previous 1 2 3 4 5 6 … Next)
The DataPager uses a QueryString:

<asp:DataPager runat="server" ID="DataPager1" PagedControlID="ListView1" PageSize="5"     QueryStringField="page"  OnPreRender="Pager_PreRender" >
    <Fields>
        <asp:NextPreviousPagerField ButtonType="Button" PreviousPageText="Previous" />
        <asp:NumericPagerField ButtonType="Link" ButtonCount="10" />
        <asp:NextPreviousPagerField ButtonType="Button" NextPageText="Next" />
    </Fields>
</asp:DataPager>

This produces the following URL:

http:// localhost /MyProject/view/Customers?page=1

Lets say I’m in Tab3: Orders, if I navigate to the next Page a postback occurs and Tab1: Customers is displayed instead and that is because the URL indicates view/Customers?page=1
Is there anyway to achieve paging without using the QueryString?

Here is where I use the QueryString:

    protected void Pager_PreRender(object sender, EventArgs e)
    {
        int CurrentPage = 0;
        Int32.TryParse(Request.QueryString["page"], out CurrentPage);
        CurrentPage = CurrentPage.Equals(0) ? 1 : CurrentPage;

        HyperLink PreviousLink = DataPager1.Controls[0].Controls[0] as HyperLink;
        HyperLink NextLink = DataPager1.Controls[2].Controls[0] as HyperLink;
        if (PreviousLink != null)
        {
            if (CurrentPage.Equals(1))
            {
                PreviousLink.Visible = false;
            }
            else if (CurrentPage > 1)
            {
                PreviousLink.Visible = true;
            }
        }
        if (NextLink != null)
        {
            if ((CurrentPage * DataPager1.PageSize) >= DataPager1.TotalRowCount)
            {
                NextLink.Visible = false;
            }
            else
            {
                NextLink.Visible = true;
            }
        }
    }
  • 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-09T18:16:55+00:00Added an answer on June 9, 2026 at 6:16 pm

    You could use a PagingDataSet and use a HiddenField to store the page index. Just explained in another answer…

    Custom datatable with paging

    Make sense?

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

Sidebar

Related Questions

I have a tab-control that has 4 tab pages. Each tab page contains a
I have a TabControl that contains several tabs. Each tab has one UserControl on
I have Tab Control, with two tabs, and each tab contains a UserControl, the
Problem I have a custom tab control using Chrome-shaped tabs that binds to a
I have a tab control in my WPF application with multiple tabs. Each tab
I have a popup that contains a TabNavigator control. The tabs are dynamically added
I have a resizable dialog that contains a CTabCtrl, the tab control has 4
I have a C# program that has two forms. One form contains tab control
i have a mvvm app that the main window is a tab control. i
I have a workbook that has many checkboxes (form control) on one tab. I

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.