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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:33:35+00:00 2026-06-08T04:33:35+00:00

I am trying to find a solution in asp.net in order to achieve paging

  • 0

I am trying to find a solution in asp.net in order to achieve paging of data so
1) Application does not have to connect to DB on each page index change, in order to retrieve either entire set or just a paged set of results
2) Do not want to store results in Viewstate or Session

For large result sets, I was thinking of storing key values (ID, rownumber) in a result set (array, json) and then populate additional row information on row binding.

Is there a way to do it in asp.net, or I need to consider jQuery for this scenario.

  • 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-08T04:33:38+00:00Added an answer on June 8, 2026 at 4:33 am

    1) Application does not have to connect to DB on each page index change, in order to retrieve either entire set or just a paged set of results

    You need to cache your results. For example:

    Example:

    Caching Approach 1

        <asp:SqlDataSource runat="server" ID="sdsd"
            SelectCommand="select * from jobs"
            SelectCommandType="Text"
            DataSourceMode="DataSet"
            ConnectionString="<%$ConnectionStrings: PUBSConnectionString %>"
            CacheDuration="30"
            EnableCaching="true"
        >
        </asp:SqlDataSource>
        <asp:DropDownList ID="ddl" runat="server" AutoPostBack="true" DataSourceID="sdsd" DataTextField="job_desc" DataValueField="job_id">
        </asp:DropDownList>
    

    Caching Approach 2

    You could always cache your results in code:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            IEnumerable<employee> res = Enumerable.Empty<employee>();
    
            if (this.Cache["emp"] == null)
            {
                res = this.GetEmployeesFromDatabase();
                this.Cache["emp"] = res;
            }
            else
            {
                res = this.GetEmployeesFromCache();
            }
    
            this.grv.DataSource = res;
            this.grv.DataBind();
        }
    }
    
    protected IEnumerable<employee> GetEmployeesFromDatabase()
    {
        // go to your database to get the objects
        return Enumerable.Empty<employee>();
    }
    
    protected IEnumerable<employee> GetEmployeesFromCache()
    {
        return this.Cache["emp"] as IEnumerable<employee>;
    }
    

    Keep in mind that the returned object must to be a DataSet or DataTable in order to add sorting capabilities to your cache results

    2) Do not want to store results in Viewstate or Session

    Again you need to use cache

    Is there a way to do it in asp.net, or I need to consider jQuery for this scenario.

    I don’t see how jQuery (by itself) can help you with your requirement, I mean if you use AJAX posts, you would improve the perceived performance of your current page, but that won’t help you with the connections to the database unless you use caching

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

Sidebar

Related Questions

I have been trying to find a solution to this one but could not
I am trying to find a solution to prevent race conditions in my application
I was trying to find a solution but did not succeed even if it
I have searched around Google and StackOverflow trying to find a solution to this,
I have a basic ASP.Net MVC 3 application which has a number of controllers
i am trying to use the JQuery tool tip in asp.net application but no
I've got three C# ASP.NET MVC2 projects within a single solution. Names have been
I am converting an ASP.NET MVC3 project to MVC4. I was trying to find
I have been looking around for hours trying to find a clear simple solution
ASP.NET front-end .aspx page (hiding code when deployed). I'm trying to simply have a

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.