views:

178

answers:

4

Possible Duplicates:
Advice on using ASP.net WebForms or MVC
How to decide which is right, WebForms or MVC when doing ASP.NET

I am new to web development and asp.net... I was going through asp.net website and 'n' number of question here in stackoverflow regarding Webforms or MVC.... But still as a beginner can't get an idea what to choose?

  • What should i choose webforms or mvc?
  • If MVC,What should i know before getting started with it?
  • If webforms,What should i know before getting started with it?
+6  A: 

In terms of specific reasons to consider Web Forms for new projects:

1) If you are using SharePoint. Today SharePoint sites more naturally integrate Web Forms web-parts/pages in them. The SharePoint team would like to add MVC support in the future - but if your site/solution integrates with SharePoint today or the new version coming out you'll find Web Forms easier to-do this.

2) If you are building an application where an existing server control or set of server controls can help provide a lot of functionality. This is true for a lot of reporting scenarios (where you can leverage charting controls) as well as data editing scenarios involving grids (where you can leverage data controls). There are also a rich set of server-side controls that have AJAX functionality encapsulated within them that a lot of developers find really useful for common scenarios.

3) Where you are building an application (typically intranet based) where you need to support older browsers or have strict accessibility requirements that rule out modern JavaScript frameworks, and so must put a lot of UI logic on the server. If you don't care about SEO (because it is an intranet app) and don't care about having complete control over your HTML then using controls with built-in functionality can provide productivity.

In terms of specific reasons to consider MVC for new projects:

1) If you are building a public facing web-site where SEO, semantic URLs/HTML, and full control over the HTML is important. While ASP.NET 4 does provide a lot of new features for Web Forms to enable this - MVC still provides more total control.

2) If you what to use a TDD workflow and/or easily unit test your app. While you can use the MVP pattern with Web Forms, MVC provides a core approach that naturally supports this.

3) If you want to build a heavy AJAX client-side app, the total control over the HTML/URLs provided by MVC can be an advantage. You can still accomplish this with web forms (especially with ASP.NET 4) - but if you want total client-side JS control MVC is probably a more attractive option.

4) If you want the ability to customize/extend almost every layer of the web-framework, ASP.NET MVC provides the hooks necessary to-do so. Want a different view engine, integrate an IOC container, etc - then MVC provides some nice hooks.

From the comments section:

http://weblogs.asp.net/scottgu/archive/2010/01/24/about-technical-debates-both-in-general-and-regarding-asp-net-web-forms-and-asp-net-mvc-in-particular.aspx

Raj Kaimal
A: 

Web Forms may be better choice if your are building an intranet site with lots of data editing.

http://www.asp.net/web-forms/

ASP.NET MVC may be better choice if you are building a test driven Internet site where HTML, performance, and scalability are main concern.

http://www.asp.net/mvc/

Muktadiur Rahman
A: 

Both the things are preferable for development but it depends on your scenario what the thing you are developing. If you r developing an new idea with rapid development i will suggest to use MVC. In MVC your code is manageable and configurable. MVC is scalable and has no performance issues.

I would prefer MVC as ideal development methodology/pattern.

Xulfee