14

I am often getting a Client Disconnected message. I don't use load balancing - only a single IIS server. I need to know what is causing this and how to fix it.

Here is the exception info:

Type: System.Web.HttpException
Message: The client disconnected.

Exception Data: 

Source: System.Web

TargetSite: Void ThrowError(System.Exception, System.String, System.String, Boolean)

StackTrace: 
   at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
   at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
   at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
   at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()
   at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
   at System.Web.UI.Page.LoadAllState()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2
  • FWIW, looks like there's a similar question already: stackoverflow.com/questions/809413/… Jun 11, 2009 at 0:51
  • 1
    @ChrisW.Rea Yes, but this one specifies a single IIS server, where the other specifically mentions load balancing. The answer I was looking for is on this question and not the other. Dec 13, 2013 at 16:38

3 Answers 3

9

WE get this exception as well, and we get it in a completely repeatable way. This exception is thrown when the ViewState has become "large" and the user clicks a button before a previous request has completed...

In our case this happens very easily because the post back is using ajax, so the browser doesn't stop responding while the ViewState is being sent to the server. Clicking on this control causes the exception over and over again.

2
  • This explains why it is happening.so how to resolve this type of issues if the client requirement is like you said.or we can ignore this one?
    – Ajay
    Apr 29, 2015 at 11:45
  • There are a couple of ways to reduce the impact of ViewState. One way is to create your own viewstate provider and stop sending it over the wire. Another is to disable it and do the work to make the page function without it. The most drastic way, and the path we've been headed down, is to port your pages to MVC. May 6, 2015 at 0:01
4

This also happens when your page allows the end user to make multiple partial postbacks without waiting for the response. Meaning, Assume a table where a click on a row does a partial postback and shows him the details of that row. Now if the user one row and without waiting for details, clicks another row... chances are there this exception to occur.

The ASP.NET AJAX abandons the already executing request when a new async request is made.

However What remains ununderstood is why does IIS allow such abandoned request to reach ASP.NET at all..

1

It's possible that users are aborting the page post-back by clicking STOP or RELOAD in the browser. Does your application have some pages that are quite heavy, e.g. lots of viewstate, and do you have users that are on slower connections, e.g. dialup?

2
  • This is not what is happening. All local connections are 100MB/1GB and this happens on many different pages. We do use lots of viewstate and there is no effective way around that. The problem seems to occur almost randomly.
    – Bob Jones
    Jun 11, 2009 at 15:03
  • What is the use case that you actually need to stop this error from happening?
    – s_hewitt
    Nov 14, 2009 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.