PC Review


Reply
Thread Tools Rate Thread

Asyncronous aspx page

 
 
Josema
Guest
Posts: n/a
 
      7th Oct 2008
Hi,

I would like to use an asynchronous page, but this is my first time for this.

I would like to loop from 1 to 5000000 and do it asyncronously. With the
code below, the loop is executing asyncronously, but my problem is that the
render method of the page, is executing before the looping ends.

How its possible dont render until the loop is finished? What could be the
best approach for this example?

Here is the code:

public delegate void LooperAsyncHandler();
public partial class _Default : System.Web.UI.Page
{
private Looper looper;
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
looper = new Looper(5000000);
LooperAsyncHandler handler = new LooperAsyncHandler(looper.DoLoop);
handler.BeginInvoke(EndLooping, null);
}
}
private void EndLooping(IAsyncResult ar)
{
}
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
}
}

Thanks for the info.
Kind Regards.
Josema.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fire off a completely seperate .aspx page from within an .aspx web page. S_K Microsoft ASP .NET 1 2nd Oct 2007 01:05 AM
How to fire off a completely seperate .aspx page from within an .aspx web page. S_K Microsoft ASP .NET 0 1st Oct 2007 11:40 PM
How to fire off a completely seperate .aspx page from within an .aspx web page. S_K Microsoft ASP .NET 0 1st Oct 2007 11:40 PM
Syntax for call from aspx page to .cs file then to different aspx page MadHatter51 Microsoft ASP .NET 1 17th May 2006 11:43 AM
How to Pass values between from a popup page aspx & a normal page aspx Marco Antonio Montalvo Durán Microsoft ASP .NET 2 23rd Jan 2004 09:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:40 PM.