vote up 8 vote down
star
2

Hi,

If given the choice, which path would you take? 1. asp.net webforms + asp.net ajax

or

  1. asp.net mvc + ajax framework of your choice (jquery, yui, prototype, etc).

Focus point: Are their any limitations to #1, or hurdles since it is less 'free/open'

flag
add comment

9 Answers:

vote up 8 vote down

I've done both lately, I would take MVC nine times out of ten.

  • I really dislike the implementation of the asp.net ajax controls, I've run into a lot of issues with timing, events, and debugging postback issues. I learned a lot from http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/
  • The asp.net project we used the MVP pattern http://www.codeplex.com/aspnetmvp, and the pattern worked great. However we ended up with a lot of code in the view because we were directly interacting with the server side controls (i.e a lot of gridview manipulations). This code is nearly untestable with the unit test frameworks. We should have been more diligent about keeping code out of the view, but in some instances it was just easier and less messy.

The one time I would choose using asp.net forms development would be to use the gridview control. We are using jquery for our javascript framework with MVC and have not yet found a very good gridview like control. We have something that is functional, but the amount of time we have sunk into learning, tweaking, and debugging it vs using asp.net server side controls has been substantial. One looses all of the nice widgets Microsoft provides out of the box doing non asp.net form development. The loss of those widgets is freeing, and scary at the same time when you first start.

At the end of the day I'm happy we are doing MVC development. My team and I have learned a new framework, (we were only asp.net developers before), and have gotten our hands dirty with html and javascript. These are skills we can take onto other projects or other languages if we ever need to.

link|flag
add comment
vote up 2 vote down

Webforms with ASP.NET Ajax is heaven. The integration between the 2 is just amazing and feels so natural to work with.

Using webforms instead of mvc will give you the ability to utilize the lifecycle to develop very good and re-usable controls.

But I still like to add a little jQuery into the mix for traversing the dom and adding animations, I just like to use asp.net ajax to get the integration with the server side.

link|flag
My thoughts exactly, I hope the AJAX for MVC is as easy when I get around to learning it – lobsterino Apr 11 at 7:46
add comment
vote up 1 vote down

ASP.NET MVC is still in "Preview" form, and as such I wouldn't consider it until it matures. You can roll-your-own MVP pattern pretty easily without much plumbing.

On the Ajax front, I'd say try to find libraries (commercial or otherwise) that do what you're looking for. The basics (Grids, trees, autocomplete textboxes, etc.) have been done to death. Don't Reinvent The Wheel.

link|flag
ASP.NET MVC may be in RC, but it's interesting to note that Stackoverflow is completely built upon ASP.NET MVC. – Notorious2tall Feb 6 at 16:10
Sure, that doesn't mean I'd trust it for a system that's being used to pay the bills. StackOverflow.com, when it was started was just a plaything. – Giorgio Galante Feb 9 at 15:31
add comment
vote up 1 vote down

The concept behind MVC is great, but be prepared to loose virtually all the functionality of all the server controls you've used for so many years. I've only looked at the MVC implementation for about a week now, but the page lifecycle and view state are gone so these controls no longer function properly.

I was also stunned to find a number of examples containing a lot of logic code in the markup. That's right, 'if' and 'foreach' statements in the aspx files -- a horrible step backwards imho. I was very happy to leave classic asp behind but in the current implementation of the asp.net mvc pattern you're back to code in your markup, the need to use helpers everywhere, and the lack of virtually any useable server controls.

If you're starting a new project now I'd recommend sticking with asp.net webforms and make use of a the built in asp.net ajax, the toolkit, and jQuery as needed. The asp.net ajax implementation may not be the absolute best, or most efficient implementation, but unless you're getting a million uniques on day 1 or your server is a commodore vic 20 the performance hit isn't going to be that noticeable.

This of course does depend on your project size. If you're starting a 5 year Enterprise level application that expect millions of page views, UpdatePanel might not cut it, but if you're building an average site, throwing up a prototype, or just need to get moving fast, asp.net ajax works perfectly fine and has an extremely low learning curve.

And to be clear, the entire page is absolutely not returned every time an ajax call is made. /Only/ the content for the panel that needs to be updated is sent across the wire. Any http monitor will prove this point. Yes, the page /lifecycle/ is performed, but knowing that you can can build fairly efficient asp.net ajax applications.

link|flag
Re: UpdatePanels, that is not remotely accurate. Even sites serving only a single concurrent user see massive performance increases when replacing UpdatePanels. You have to care very little about your users' experience on your site to use them in production. – Dave Ward Dec 29 at 15:14
add comment
vote up 0 vote down

I've used asp.net winforms with ajax.net as well as prototype/ext/jquery. I guess something to consider is the goal of the site.. MVC is a popular pattern. I can't say anything against ASP MVC because I haven't had a chance to use it, but I want to make sure you know you are not limited to just ajax.net if you chose webforms.

link|flag
I wanted to clarify. I am looking forward to doing a MVC project just haven't had a spark to start one yet. Didn't want to sound like I was discouraging MVC development. – Quintin Robinson Sep 19 at 2:51
add comment
vote up 0 vote down

When I am designing a site one of the big things I prefer is the DRY principle. IMO ASP.NET MVC is much more dry than web forms.

I have recently made the move from webforms to MVC and I hope I never have to go back!

link|flag
add comment
vote up 0 vote down

I love webforms, but ASP.NET AJAX is a pile of crap.

I prefer to use WebForms + custom HTTPHandlers handling the server side of any AJAX calls.

Heh, downvoted...

ASP.NET AJAX Is a pile of crap because a callback requires the entire page class to be reinstantiated, you aren't calling a single method, you are rebuilding the entire page on the server everytime.

Also, UpdatePanels return the entire page, only the section in the update panel is popped in, its a total waste of bandwidth.

I understand why its done this way, because WebForms controls can't really be easily other ways, but it still is really lousy.

link|flag
Now I'm curious. What would a sample implementation of WebForms + ASHX be like? – Bullines Sep 19 at 2:51
You aren't limited to ASHX with the handler implementation, you can group handlers in class files and add the handlers to your webconfig. Very efficient as well but it depends on what you want to accomplish. A for instance would be to make an call with limited overhead to lock a record in a DB. – Quintin Robinson Sep 19 at 2:54
Can you elaborate on "pile of crap"? – Jon Limjap Sep 19 at 3:22
I agree that sending HTML instead of JSON is additional data over the wire. But its no more than moving between pages on a standard site. Also ASP AJAX gives webservice interaction, which is taking the result of a SOAP call and converting it to JSON. Thats pretty nice. – Owen Nov 24 at 17:59
If you use WebMethods/PageMethods, you won't get the entire page. – Lurker Indeed Dec 24 at 0:35
add comment
vote up 0 vote down

I agree that asp.net ajax UpdatePanels are not an ideal solution.

We have avoided using them and instead have been using the client-side libraries to do any communication with the server. I do like what I saw at PDC about the features coming in asp.net ajax 4.0 with declarative components and client-side templating - very nice! Combining JQuery with the existing libraries provides quite a bit - and I have questioned using JQuery exclusively instead given it's much smaller footprint and it's ability to do a lot of the same things as the asp.net ajax client library.

As far as the server stack - I haven't used MVC yet, but we have had success using a home-rolled MVP approach using webforms.

link|flag
add comment
vote up 0 vote down

If you need update panel, I suggest you to use open source and lite MagicAjax or ComfortASP. If you need framework helps developing custom ajax, I suggest jQuery.

link|flag
add comment

Your Answer:

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.