I want my program to do two back to back webrequests. The first one fills out the form on the page. The second webrequests a page which submit the data from the previous webrequest.

I tried doing this but I keep getting this error:

The request was aborted: The connection was closed unexpectedly

I want my program to do two back to back webrequests. The first one fills out the form on the page. The second webrequests a page which submit the data from the previous webrequest.

I tried doing this but I keep getting this error:

The .NET HTTP implementation tries to keep the connection alive as long as possible in order to avoid the overhead of creating a new conneciton. If the server decides to close the connection without notifying the client you may see this error. In general, you need to catch these exceptions in your application and create a new connections as necessary. The client proxy code is not really related other than by the fact that it uses the .NET HTTP implementation.

There is a server side connection timeout in ASP.NET that you can configure, and it may be causing this problem. Check:
http://msdn.microsoft.com/en-us/library/e1f13641(vs.71).aspx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.