Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would I use ASP.NET MVC on a public site and WebForms on an Intranet?

I asked this question:

Is ASP.NET MVC destined to replace Webforms?

and a few answers were that if the website were public/Internet to use MVC, but if it were internal to use WebForms. I saw some of the reasons for it but some of them didn't really help me understand why this rational would be so.

I was hoping for comments. Why would I not want to use ASP.NET MVC for everything besides a small one off website? Why would Internet or Intranet matter?

Also, I know one tool doesn't do everything. I do not want to use webforms, not that I think I cannot or that it is somehow "bad." In this question, I am asking specifically about MVC and why it would matter for the location of the website (public or private.)

Thank you.

like image 514
johnny Avatar asked May 22 '09 14:05

johnny


People also ask

When should I use ASP.NET MVC vs Web Forms?

Asp.Net Web Form has built-in data controls and best for rapid development with powerful data access. 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 an interactive web application with the latest web standards.

Why should I use ASP.NET MVC?

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.

Is it possible to create web application with both Web Forms and MVC?

Luckily, the answer is yes. Combining ASP.NET Webforms and ASP.NET MVC in one application is possible—in fact, it is quite easy. The reason for this is that the ASP.NET MVC framework has been built on top of ASP.NET.

Is MVC faster than Web Forms?

If you want to have a faster development cycle than Web Forms might be the best option. If time, money, and energy to develop an application from the scratch is not a constraint then MVC could potentially be the better option.


2 Answers

I think I have an idea as to why that internal vs external distinction came up in your previous question.

Using MVC for external websites affords you the flexibility needed to support more browsers and makes developing web standards compliant sites easier. MVC requires a little bit more work to do some of the same things as Web Forms, but you have more control over what is output to the client.

Using WebForms for internal apps is suggested because you have full control over what browsers are used on your network. Also, internal apps are typically not given the same budgets as external sites. Web Forms allows you to whip together a database grid, paging, sorting, etc in a matter of minutes by dragging and dropping code to an ASPX page. The motivation I believe is purely money and time based.


I however do not think that this line in the sand is a good one to make. I know there are some websites that I have worked on with WebForms that required a lot of hair pulling that simply wouldn't have happened if I used MVC. But I also have some sites that didn't need the level of flexibility, so I used WebForms.

The biggest advantage that I see with ASP.NET MVC is AJAX. It is easier for me to deal with jQuery AJAX requests when using MVC as opposed to WebForms. I am also a control freak, so using MVC satisfies that aspect as well...

like image 124
Astra Avatar answered Oct 07 '22 08:10

Astra


The location is not very important, what was being explained was that a typical intranet website has the following properties:

  • Very low user load, usually served on internal LAN
  • Very short development schedules
  • Very frequency "feature additions" that consist of CRUD add ons

So developing it with MVC can be overkill, instead of slapping together something with WebForms.

like image 41
David Avatar answered Oct 07 '22 07:10

David