aspx hanging ?

A

andersboth

If i in my aspx cs file put code like this:

public delegate void TimeOutDelegate();

public void timeOut()
{
Thread.Sleep(8000);
}

private void Page_Load(object sender, System.EventArgs e)
{
Label1.Text= DateTime.Now.ToLongTimeString() + ":" +
DateTime.Now.Millisecond ;
TimeOutDelegate timeOutDelegate = new TimeOutDelegate(this.timeOut);
timeOutDelegate.BeginInvoke(null,null);
}

And then in aspx file a Label1, and a <META HTTP-EQUIV="Refresh"
CONTENT="0"> , to make it reload all the time.

Then the aspx page start haging or get delayed after a short time. I
think this is because some settings in IIS or
machine.config.

How come this happen ?

What settings do i need to change to avoid this ?

Best Regards, and thx if someone can help , Anders, Denmark,.
 
B

bruce barker

if you have session state enabled, then page requests (for the same
session) are serialized (queued) to control access to session. just
disable session.

-- bruce (sqlwork.com)
 
G

Guest

I think the bigger question here is, "why do you want to halt page processing
on the server" for 8 seconds? If you want a dynamically refreshing "timed
label" the preferred way to do this is with client script and the setInterval
method.
Peter
 
A

andersboth

To set <sessionState mode="Off"> did not solve the problem, it remains
the same to me, that asp.net gets hanging or delayed.

If someone have more tips or ideas they are still very welcome !.

-> Peter Bromberg. This is just a "Hello World" sample to generate
the "bug/situation". I really need to find out why this kind off code
makes the asp.net hanging for me.

Best Regards, and thank you.

Anders Both
 
A

andersboth

Remark: The Thread.Sleep(8000) is called in a asynchronous way, so the
asp.net page should not hang for 8 sec. And it does not hang for 8
sec. It only hangs if you keep on reffreshin the page with a <META
HTTP-EQUIV="Refresh"
CONTENT="0">

* *

I know this is a maybe a very strange question, but still i hope some
one got some ideas or oppionions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top