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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:22:37+00:00 2026-05-27T22:22:37+00:00

I have a web application under IIS 7. There is a page with Button1

  • 0

I have a web application under IIS 7. There is a page with Button1. When I click this Button1 the following method fires:

string url = "http://example.com";

string resultStr = "";

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();

string encoding = resp.CharacterSet;
if (encoding.Equals(String.Empty)) encoding = "UTF-8";

Stream strResponse = resp.GetResponseStream();

int bytesSize = 0, c = 0;
byte[] downBuffer = new byte[2048];//2kb

while ((bytesSize = strResponse.Read(downBuffer, 0, downBuffer.Length)) > 0)
{
    if (++c > 100) break;//200kb - max
    downBuffer = Encoding.Convert(Encoding.GetEncoding(encoding), Encoding.UTF8, downBuffer);

    string tempString = Encoding.UTF8.GetString(downBuffer, 0, bytesSize);
    resultStr += tempString;
}

strResponse.Close();

TextBox1.Text = resultStr;

As you can see TextBox1 will contain html code of remote page.

There is a problem: while this method is running I can’t load other pages! How to solve this problem?

I know that there is an application pool which store application threads so server can process several threads at the same time… But it doesn’t works for me. Why?

  • 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-27T22:22:38+00:00Added an answer on May 27, 2026 at 10:22 pm

    I suspect that you are using Session in your application, do you? Session is not thread-safe. This means that if you are using Session, ASP.NET locks the entire request and doesn’t allow other requests (from the same Session) to run in parallel. Requests from the same session run sequentially. You can have multiple requests from different sessions running in parallel though.

    In fact it’s a little more subtle than that. ASP.NET uses a ReaderWriterLock to synchronize access to the session object, meaning that you can have 2 requests from the same session that are only reading from it run in parallel, but as long as you have a write access to the session it will block other parallel requests from the same session.

    You could control this using the EnableSessionState="ReadOnly" in your page to indicate that it is only reading from the session and thus allow for parallel execution of requests.

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

Sidebar

Related Questions

I have a web application that deploys with two virtual directories under it's IIS
I have MVC3 web application running under IIS 7. During initialization in global.asax application
I have a web application that runs fine under IIS5 or IIS6. I just
I have a small web application with ASP.NET AJAX running well under the Cassini
I have a WCF Web Service which is kept under an Application Pool on
I have a web application written in C# and running as a dll under
I have an ASP.NET MVC web application running in IIS as a subweb; let's
I have one application App1 under IIS. Inside App1 I have another application called
Hi Developers/Architects, This is more of an Architectural question: I have a web application.
I'm running win server 2008 R2 with IIS 7.5 I have an application under

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.