Performance with ASP.NET AJAX (hockblogs.net)
submitted by
hockman(505) 3 years, 5 months ago
Hi there,
In my series of 'Performance with ASP.NET AJAX & Client Repeater Control', which I started about three weeks ago, now it is already time for part 4 of the series, namely: Performance with ASP.NET AJAX & Client Repeater Control - Part 4 - String Concatenation.
These are the articles that I have already written about:
* Performance with ASP.NET AJAX & Repeater Server Control - Part 1 - The Updatepanel
* Performance with ASP.NET AJAX & Client Repeater Control - Part 2 - Using StringBuilder
* Performance with ASP.NET AJAX & Client Repeater Control - Part 3 - DOM Create element
* Performance with ASP.NET AJAX & Client Repeater Control - Part 4 - String Concatenation
Things in this solution are a little bit different compared to the Server side Repeater control and updatepanel approach. The overall aspect is exact the same as written in part 2 of the series, except for the client-side code to built the results table.
These are the things I have done (which can be seen when you download the source files below):
1. Setting up a page with a generate data button to retrieve a set of 3000 person records
2. Setting up a local webservice that will get the data (could have been a PageMethod).
3. Invoking the webservice from client script
4. Cathing the results and build a client repeater using the old fashioned string concatenation stuff.
So this is how my page looks when invoking the Generate button for the first time:
When invoking the 'Generate data button', a client side script is invoked, that on its turn will call the local webservice, which was referenced as a script resource in the scriptmanager. The local webservice is called that returns the 3000 person records (I wanted a large resultset, so you could see that the performance issues arise when using an updatepanel as in my previous post). When the data was retrieved from the local webservice it is handled in client script by making use of string concatenation.
This is the call to the local webservice:
PersonService.GeneratePersons(onSuccess, onFailed);
This is the javascript used to make up the table:
function BuildTable(results) {
var table = '<table><tbody>';
var header = '<tr>';
header += "<td width='100px' valign='top' align='left'>Id</td>";
header += "<td width='100px' valign='top' align='left'>Name</td>";
header += "<td width='100px' valign='top'
|category: AJAX
|Views: 22
tags:
AJAX another
Everyones tags:
Your Tags: