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

  • Home
  • SEARCH
  • 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 1025459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:55:53+00:00 2026-05-16T11:55:53+00:00

I have a web app, that consumes a web service. The main page runs

  • 0

I have a web app, that consumes a web service. The main page runs a search – by passing parameters to a particular web service method, and I bind the results to a gridview.

I have implemented sorting and paging on the grid. By putting the datatable that the grid is bound to in the viewstate and then reading / sorting / filtering it as necessary – and rebinding to the grid.

As the amount of data coming back from the web service has increased dramatically, when I try to page/sort etc I receive the following errors.

The connection was reset

The connection to the server was reset while the page was loading.

I have searched around a bit, and it seems that a very large viewstate is to blame for this.
But surely the only other option is to

  1. Limit the results
  2. Stick the datatable in the session rather than the viewstate
  3. Something else I am unaware of

Previously I did have the datatable in the session, as some of this data needed to persist from page to page – (not being posted however so viewstate was not an option). As the amount of data rose and the necessity to persist it was removed, I used the viewstate instead. Thinking this was a better option than the session because of the amount of data the session would have to hold and the number of users using the app.

It appears maybe not.

I thought that when the viewstate got very big, that .net split it over more than one hidden viewstate field, but it seems all I’m getting is one mammoth viewstate that I have trouble viewing in the source.

Can anyone enlighten me as to how to avoid the error I’m getting? If it is indeed to do with the amount of data in the viewstate?

  • 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-05-16T11:55:53+00:00Added an answer on May 16, 2026 at 11:55 am

    It sounds like your caching the whole dataset for all pages even though you are only presenting one page of that data. I would change your pagination to only require the data for the current page the user is on.

    If the query is heavy and you don’t want to have to be constantly calling it over and over because there is a lot of paging back and forth (you should test typical useage pattern) then I would implement some type of caching on the web service end to cache page by page (by specific user if the data is specific to a user) and have it expire rather quick (eg a few minuites).

    I think you need to limit the total amount of data your dealing with. Change your code to not pass back extra data that might never be needed is a good place to start.

    EDIT: Based on your comments:

    1. You can’t change the web service
    2. The user can manipulate the query by filtering or sorting
    3. There is a large amount of data returned by the web service
    4. The data is user specific

    Well I think you have a perfect case for using the Session then. This can be taxing the the server with large amounts of users and data so you might want to implement some logic to clear the data from the Session and not wait for it to expire (like on certain landing pages you know the user will go when they are done, clear the session data).

    You really want to get it out of the ViewState beacuse it is a huge bandwidth hog. Just look at your physical page size and that data is being passed back and forth with every action. Moving it to the Session would eliminate that bandwidth useage and allow for you to do everything you need.

    You could also look at the data the web service is bringing back and store it in a custom object that you make as ‘thin’ as possible. If your storing a DataSet or a DataTable in your Session, those objects have some extra overhead you probably don’t need so store the data as an array of some custom thin object and just bind to that. You would need to map the result from the WS to your custom object but this is a good option you cut down on memory useage.

    Let me know if there is something else I am missing.

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

Sidebar

Related Questions

I have a Delphi XE app that consumes a web service written in Cold
I have a WCF app that consumes an asmx web service. I use the
I have a web app that runs fine in Visual web developer. But when
I am creating an iOS app that consumes web services. I have a class
I'm developing a JSF 2.0 app that consumes a SOAP-based web service. I want
I have a .Net web service client that consumes a Java web service. When
I have a HTML5/JavaScript web app that interacts with a WCF RESTful Service. What
I have a medium sized asp.net MVC app. It consumes a service layer that
We have a .net 3.5 web app that consumes third party web services. The
I have a Silverlight app that consumes a WCF service in my asp.net application.The

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.