Friday, May 16, 2008

Partial rendering without UpdatePanel

Performance on the Visual Studio development web server was slower than I expected. I don't have any benchmarks, but I thought the boss' initial yawn when I tried to show him the prototype was sufficient. So, after not getting much perceived performance gain even with the LINQ queries all tightened up, I stumbled onto the AJAX-ed UI templating sans Upload Panel technique as Scott Guthrie posted on his blog about some time ago. I thought this technique was quite suited to my application since it used a lot of custom user controls. So, I put it in and it worked. It felt a little faster than before.

Along the way, I discovered that I couldn't implement PageMethods in the user control, but that I could get the user control to call PageMethods defined in the containing page. So in my best effort not to have my logic strewn all over the place, I put the PageMethod in a base page which each containing webpage would inherit from. I didn't want to use web services. Of course, you wouldn't understand any of this unless you read Scott's post.

In any case, I was pleasantly surprised to find out that ASP.NET 3.5 performance, particularly with LINQ was not as bad as I had experienced after deploying to a staging server. A case of premature optimization, that's all.

0 comments: