When I serve an ASP.NET page, can I display different controls on the page in parallel?

When I serve an ASP.NET page, can I display different controls on the page in parallel?

I have several Telerik controls (RadGrids) on the page, and when I look at the loaded page, it seems that the controls are database bound and are displayed sequentially. Perhaps this behavior is due to the fact that I am connected to the debugger.

Do I need to load the page and select controls for individual streams? Is this even conceptually possible or should be done sequentially?

+7
multithreading rendering
source share
2 answers

You have several options. You can use the asynchronous page of an ASP.NET page. The idea would be that you load data for each control asynchronously, and then bind this data to each control as it is received.

It will look something like this:

protected void Page_Load(object sender, EventArgs e) { if (Page.IsAsync) { dataSource.GetDataCompleted += new GetDataCompletedEventHandler(GetDataCompleted); dataSource.GetDataAsync(); } else { _yourCtl.DataSource = dataSource.GetData(); _yourCtl.DataBind(); } } void GetDataCompleted(object sender, GetDataCompletedEventArgs e) { _yourCtl.DataSource = e.Result; _yourCtl.DataBind(); } 

You would do the same for each control on the page. The end result is that the page display time will be equal to the time to render the slowest render.

An alternative method would be to use AJAX to load controls. I am not familiar with the Telerik RadGrid controller, but I would assume that it supports AJAX. Here is a link to the Telerik demo page, which shows how to perform software binding on the client side of the Telerik grid: http://demos.telerik.com/aspnet-ajax/grid/examples/client/databinding/defaultcs.aspx .

+3
source share

Take a look at this article. Hope this gives you the right direction:

http://www.codeproject.com/Articles/38501/Multi-Threading-in-ASP-NET.aspx

0
source share

All Articles