views:

233

answers:

7

I asked this question:

http://stackoverflow.com/questions/894865/is-asp-net-mvc-destined-to-replace-webforms/895400#895400

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.

+2  A: 

To me, the advantage of ASP.NET Webforms is that you can develop them more quickly than ASP.NET MVC. The cost: it is harder to make them modern CSS complient applications and the weight of Viewstate and the page life cycle.

If you have ASP.NET MVC down, there is no reason to not use that for intranet applications.

If you have invested a few years to slim down ASP.NET Webforms, you can probably use them for Internet applications.

jrcs3
+1 for para #2 - once you've seen it in action you won't want to go back (I hope!)
annakata
+3  A: 

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.

David
But if I knew MVC well, I could just as well us it? Or is MVC always going to take way longer?
johnny
I don't think it will always take way longer to make an MVC application on the intranet. But the ability to drop a GridView control on a page, wire up a few data binding and formatting events, and push it out makes it handy when they want the feature done "yesterday."
Dillie-O
+9  A: 

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...

Redbeard 0x0A
A: 

MVC provides a better separation of concerns than webforms, however, it does come with some overhead that is harder to justify on smaller projects. The decision to use the one model over the other should not be based on whether it is an intranet or internet solution but on factors such longevity, maintainability and scalability. In my experience MVC is a better choice if the project is big, has a large and varied development team and is likely to need on going maintenance. Webforms is better suited to rapid development on smaller short term projects.

Neeless to say, WebForms can and has been used on large projects as MVC can be used on smaller projects. You need to way up the benefits of each based on your project's needs.

Richard Dorman
A: 

As a side note to the other answers, in an intranet environment, URL naming conventions (i.e. /controller/method ... etc) are much less important since there's no SEO needed.

Joey Robert
+3  A: 

I think the internal/external website distinction would be better classified as data-driven websites vs. content-driven websites.

IM(very)HO using the current version of MVC to build, for example, data entry systems with lots of tabular data, inline editing, sorting, paging, filtering etc is quite a lot of work when compared to using WebForms.

However if the website is more concerned with presenting content to the end user (typical websites: blogs, e-commerce apps, portals), MVC provides many advantages over WebForms. Usually websites like these are more concerned with presentational issues (which can be a problem if you over-rely on WebForms server controls for rendering).

Andrew Corkery
A: 

I don't see the difference in this two in context of public/intranet applications, I only see difference in approach and the style of writing the application, so, choose whatever you like :)

cheers

Marko