Possible Duplicate:
Biggest advantage to using ASP.Net MVC vs web forms
I was reading this document
http://msdn.microsoft.com/en-us/library/dd381412(VS.98).aspx
Specifically the advantages and disadvantages:
Advantages of an MVC-Based Web Application
The ASP.NET MVC framework offers the following advantages:
It makes it easier to manage complexity by dividing an application into the model, the view, and the controller.
It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application.
It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure. For more information, see Front Controller.
It provides better support for test-driven development (TDD).
It works well for Web applications that are supported by large teams of developers and for Web designers who need a high degree of control over the application behavior.
Advantages of a Web Forms-Based Web Application
The Web Forms-based framework offers the following advantages:
It supports an event model that preserves state over HTTP, which benefits line-of-business Web application development. The Web Forms-based application provides dozens of events that are supported in hundreds of server controls.
It uses a Page Controller pattern that adds functionality to individual pages. For more information, see Page Controller.
It uses view state on server-based forms, which can make managing state information easier.
It works well for small teams of Web developers and designers who want to take advantage of the large number of components available for rapid application development.
In general, it is less complex for application development, because the components (the Page class, controls, and so on) are tightly integrated and usually require less code than the MVC model.
Because I am a newbie on MVC but not on webforms, I have the following questions regarding this advantages and disadvantages:?
-
MVC has no viewstate? So how can I save data in the current page? This seems a very big disadvantage.
-
Webform says that provide an extensive event model with lots of controls, Doesnt MVC support controls and events as a normal webform?
Lets suppose I am an expert on both? why would I choose one or the other?
So far the only good thing about MVC in my opinion is testability, becase Rapid Application Development in webforms win in so many ways to MVC.(Just my opinion)
Now talking about the RazonEngine, it seems like going back to the old ASP, you cant use server side controls? how is this an advantage for me?
Why do you want to save things in the page? That’s what databases are supposed to do. Save data. In the page you simply use a hidden field allowing you to refetch the data from wherever it was initially stored. And for data that can change you have form input fields, so it will be there.
No, MVC doesn’t support controls and events. It supports models, controllers and views.
That’s a subjective question for which there is no objective answer. The answer I can give you is: it will depend on the context. I agree that RAD wins in WebForms, but what you have to remember is that it is not the development of the application that costs most. It’s its support and maintenance. So if your application is written rapidly you will ship it quickly indeed but with the time if you don’t properly architect it with extensibility in mind this quick application development turns slowly into a nightmare, until the day comes where you simply have to rewrite it because it costs you so much to continue to support it.
You have total control of the markup, your pages are no longer polluted with useless ViewStates, and at last your markup validates. If you want to reuse some view portions in ASP.NET MVC you could use partial views.
Here’s what I can give you as an advice. As you are already an expert in WebForms, that will be a great advantage for you when learning ASP.NET MVC. So learn it and by learning it you will probably start to see by yourself the different advantages and be able to answer yourself the question which one of the two suits you better.