views:

103

answers:

4

We are planning to extend an existing ASP.NET application (a real huge one) to have a slicker UI. One of the requiremnents is to have a way to execute server side code without a postback (As an example, say a user clicks on a link or hovers on a link, a popup comes up which executes server side code or makes calls to the database)

We plan to add more functionality that closely aligns with the behavior of a yahoo or a google customized page.

Is UpdatePanels a way to go or should a lot of it be implemented using JavaScript? One of the main requirements is to keep the pages as light as possible and to have good performance. We don't plan on using any 3rd party components.

What technologies are suggested that will help us add UI heavy features in the future?

Edit: Thanks everyone. It appears that the approach to take is to use a JS library such as JQuery and AJAX (from initial research the PageMethod/WebMethod way of doing it)? Any more suggestions?

+2  A: 

I think that UpdatePanels are actually pretty clunky. (Actually, I think ASP.NET is pretty clunky now that I've moved to ASP.NET MVC). If the page is going to be highly interactive, I'd suggest using some sort of javascript framework, like jQuery, Dojo, MooTools, etc. that will allow you to do AJAX easily as well as manage the user experience client-side. MS is distributing jQuery with Visual Studio and has promised to support it, so you might want to consider that when making your decision.

tvanfosson
Is JQuery/AJAX a light weight way of doing things?
Both solutions use AJAX, but the UpdatePanel is both less configurable and harder to work with in my opinion. Calling WebMethods with jQuery Ajax is more flexible and easier. The base jQuery framework isn't very big and available to download via Google APIs so you can take advantage of their content delivery network.
tvanfosson
The existing application makes heavy use of codebehind methods (or methods in the base class etc). The PageMethods/WebMethods is supported only for static methods which is a paradigm shift from how we are doing things around here. We have no web services and use a regular 3 tier architecture.
You should still be able to call your PageMethods from jQuery. You just have to set up the Url in the way that ASP.NET expects. If you include a ScriptManager on the page, I believe they show up as methods on the PageMethods javascript object.
tvanfosson
Isn't it true that PageMethods need to be static? I guess we lose all the benefits of referring to a UI control from the code behind (the way it's usually done. We can't do stuff like this anymore. txtTest.Text = "test"; )
A: 

Stephen Walter did a great talk about the next version of ASP.NET Ajax 4.0. It's not an immediate solution but it's interesting to see where Microsoft is going with their Ajax framework.

ZippyV
We are currently on the 3.5 framework and usually wait a while before upgrading. So, I guess it will be a while before we move to .NET 4.0. Thanks for the link. Very informative.
A: 

There's a lot more to ASP.NET AJAX than the UpdatePanel, and a fair amount of it can be done without heavy JavaScript work. UpdatePanel is quite inefficient in terms of the amount of data send over the wire. As with everything, only optimise when you need - but bear in mind that the UpdatePanel is one of the first places to look for your slowdowns.

Dave Roberts
True, we built a huge feature set using updatepanels and are having issues with its performance. It appears that we have to shift towards client side technologies to achieve the behavior we are seeking.
A: 

Just to give you a different answer than everybody else: why not try silverlight?

Shiraz Bhaiji
Unfortunately, that's not an option. This application is way to huge to try to migrate it to use the SilverLight technology.