Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the difference between ASP.NETand ASP.NET MVC ?? Which one is better??

user-image
Question added by Deleted user
Date Posted: 2017/04/01
Javed Ahmad
by Javed Ahmad , Senior Developer , HCL Technologies Ltd

Asp.Net Web Forms:

1. Asp.Net Web Form follow a traditional event driven development model.

2. Asp.Net Web Form has server controls.

3. Asp.Net Web Form supports view state for state management at client side.

4. Asp.Net Web Form has file-based URLs means file name exist in the URLs must have its physically existence.

5. In Asp.Net Web Form, Web Forms(ASPX) i.e. views are tightly coupled to Code behind(ASPX.CS) i.e. logic.

6. Asp.Net Web Form has Master Pages for consistent look and feels.

7. Asp.Net Web Form has User Controls for code re-usability.

8. Asp.Net Web Form has built-in data controls and best for rapid development with powerful data access.

9. Asp.Net Web Form is not Open Source.

Asp.Net MVC :

1. Asp.Net MVC is a lightweight and follow MVC (Model, View, Controller) pattern based development model.

2. Asp.Net MVC has html helpers.

3. Asp.Net MVC does not support view state.

4. Asp.Net MVC has route-based URLs means URLs are divided into controllers and actions and moreover it is based on controller not on physical file.

5. In Asp.Net MVC, Views and logic are kept separately.

6. Asp.Net MVC has Layouts for consistent look and feels.

7. Asp.Net MVC has Partial Views for code re-usability.

8. Asp.Net MVC is lightweight, provide full control over markup and support many features that allow fast & agile development. Hence it is best for developing interactive web application with latest web standards.

9. Asp.Net Web MVC is an Open Source.

 

Deleted user
by Deleted user

The difference is MVC is a design pattern which allows you to provide loose coupling between the view, the controller, and the model. There is also a difference in performance.

 

But there is no such thing as an absolute answer to which is better. You'll need to specify better for what purpose!

 

Also, you cannot test the whole page in ASP.NET with an automated unit test or test frameworks because the code-behind files hook into the lifecycle of the page and have a tight dependency to the core ASP.net runtime. So the test methods will be different. For example, you can use Selenium or WatiN which has entirely different test approach.

 

http://code-desk.com/web-development/pros-and-cons-of-asp-net-web-forms-and-asp-net-mvc.html

 

You can, however, make a separation of concerns in your application design using web forms by moving all business logic to a separate domain/DLL

Eliza Nayak
by Eliza Nayak , Senior Software Developer , Ardentia Technologies Pvt Ltd

ASP.NET Web Forms:

·         Development supports state • Gives the illusion that a web application is aware of what the user has been doing, similar to Windows applications. I.e. Makes 'wizard' functionality a little bit easier to implement. Web forms does a great job at hiding a lot of that complexity from the developer.

·         Rapid Application Development (RAD) • The ability to just 'jump in' and start delivering web forms. This is disputed by some of the MVC community, but pushed by Microsoft. In the end, it comes down to the level of expertise of the developer and what they are comfortable with. The web forms model probably has less of a learning curve to less experienced developers.

·         Larger control toolbox • ASP.NET Web Forms offers a much greater and more robust toolbox (web controls) whereas MVC offers a more primitive control set relying more on rich client-side controls via jQuery (Javascript).

·         Mature • It's been around since 2002 and there is an abundance of information with regards to questions, problems, etc. Offers more third-party control - need to consider your existing toolkits.

ASP.NET MVC:

·         Separation of concerns (SoC) • From a technical standpoint, the organization of code within MVC is very clean, organized and granular, making it easier (hopefully) for a web application to scale in terms of functionality. Promotes great design from a development standpoint.

·         Easier integration with client side tools (rich user interface tools) • More than ever, web applications are increasingly becoming as rich as the applications you see on your desktops. With MVC, it gives you the ability to integrate with such toolkits (such as jQuery) with greater ease and more seamless than in Web Forms.

·         Search Engine Optimization (SEO) Friendly / Stateless • URL's are more friendly to search engines (i.e. mywebapplication.com/users/ 1 - retrieve user with an ID of 1 vs mywebapplication/users/getuser.aspx (id passed in session)). Similarly, since MVC is stateless, this removes the headache of users who spawn multiple web browsers from the same window (session collisions). Along those same lines, MVC adheres to the stateless web protocol rather than 'battling' against it.

·         Works well with developers who need high degree of control • Many controls in ASP.NET web forms automatically generate much of the raw HTML you see when an page is rendered. This can cause headaches for developers. With MVC, it lends itself better towards having complete control with what is rendered and there are no surprises. Even more important, is that the HTML forms typically are much smaller than the Web forms which can equate to a performance boost - something to seriously consider.

 

·         Test Driven Development (TDD) • With MVC, you can more easily create tests for the web side of things. An additional layer of testing will provide yet another layer of defense against unexpected behavior.

Deleted user
by Deleted user

For performance and speed:

MVC is better than ASP as in ASP it need passing all page life cycle,so it takes more time than MVC.

=============================================

For testing:

MVC is easier as you can test only the function you need, but in ASP, you need to test the whole page.

==============================================

For controls:

ASP is more easier as you can use user controls, but MVC needs to has good experience with HTML.

==============================================

Finally, MVC is better because of its performance and speed.

More Questions Like This