为什么我要在公共站点上使用ASP.NET MVC,在Intranet上使用WebForms?

时间:2021-06-04 03:13:20

I asked this question:

我问过这个问题:

Is ASP.NET MVC destined to replace Webforms?

ASP.NET MVC注定要取代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.

并且有一些答案是,如果网站是公共/互联网使用MVC,但如果它是内部使用WebForms。我看到了一些原因,但其中一些并没有真正帮助我理解为什么这种理性会如此。

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?

我希望有意见。为什么我不想将ASP.NET MVC用于除了小型网站之外的所有内容?为什么互联网或内联网很重要?

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

此外,我知道一个工具不会做任何事情。我不想使用网络表格,不是我认为我不能或者说它是某种“坏”。在这个问题中,我特别询问MVC以及为什么它对网站的位置(公共或私人)很重要。

Thank you.

谢谢。

7 个解决方案

#1


10  

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.

将MVC用于外部网站可为您提供支持更多浏览器所需的灵活性,并使开发符合Web标准的站点变得更加容易。 MVC需要更多的工作来完成与Web窗体相同的操作,但是您可以更好地控制输出到客户端的内容。

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.

建议在内部应用程序中使用WebForms,因为您可以完全控制网络上使用的浏览器。此外,内部应用通常没有与外部网站相同的预算。 Web窗体允许您通过将代码拖放到ASPX页面,在几分钟内将数据库网格,分页,排序等组合在一起。我相信的动机纯粹是基于金钱和时间。


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.

然而,我不认为沙子中的这条线是一个很好的线。我知道有一些网站我使用WebForms需要大量的头发拉动,如果我使用MVC就不会发生这种情况。但我也有一些不需要灵活性的网站,所以我使用了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...

我在ASP.NET MVC中看到的最大优势是AJAX。在使用MVC而不是WebForms时,我更容易处理jQuery AJAX请求。我也是一个控制狂,所以使用MVC也满足了这个方面......

#2


4  

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

位置不是很重要,正在解释的是典型的Intranet网站具有以下属性:

  • Very low user load, usually served on internal LAN
  • 用户负载非常低,通常在内部LAN上提供
  • Very short development schedules
  • 非常短的开发时间表
  • Very frequency "feature additions" that consist of CRUD add ons
  • 非常频率的“功能添加”,包括CRUD附加功能

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

因此,使用MVC进行开发可能会过度,而不是使用WebForms拼凑一些内容。

#3


4  

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.

IM(非常)HO使用当前版本的MVC构建,例如,与使用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).

但是,如果网站更关注向最终用户呈现内容(典型的网站:博客,电子商务应用程序,门户网站),MVC提供了许多优于WebForms的优势。通常这类网站更关注表现问题(如果过度依赖WebForms服务器控件进行渲染,这可能是一个问题)。

#4


2  

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.

对我而言,ASP.NET Webforms的优势在于您可以比ASP.NET MVC更快地开发它们。成本:很难使它们成为现代CSS兼容应用程序以及Viewstate和页面生命周期的重量。

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

如果您关闭了ASP.NET MVC,则没有理由不将其用于Intranet应用程序。

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

如果您投入了几年时间来减少ASP.NET Webforms,那么您可以将它们用于Internet应用程序。

#5


1  

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.

MVC提供了比webforms更好的关注点分离,然而,它确实带来了一些在较小的项目上难以证明的开销。使用一个模型而不是另一个模型的决定不应该基于它是内部网还是互联网解决方案,而是基于长寿,可维护性和可扩展性等因素。根据我的经验,如果项目很大,拥有庞大而多样化的开发团队并且可能需要进行维护,MVC是一个更好的选择。 Webforms更适合在较小的短期项目中快速开发。

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.

不用说,WebForms可以并且已经用于大型项目,因为MVC可以用于较小的项目。您需要根据项目的需求提高每个方面的好处。

#6


1  

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

干杯

#7


0  

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.

作为其他答案的旁注,在内联网环境中,URL命名约定(即/控制器/方法等)不太重要,因为不需要SEO。

#1


10  

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.

将MVC用于外部网站可为您提供支持更多浏览器所需的灵活性,并使开发符合Web标准的站点变得更加容易。 MVC需要更多的工作来完成与Web窗体相同的操作,但是您可以更好地控制输出到客户端的内容。

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.

建议在内部应用程序中使用WebForms,因为您可以完全控制网络上使用的浏览器。此外,内部应用通常没有与外部网站相同的预算。 Web窗体允许您通过将代码拖放到ASPX页面,在几分钟内将数据库网格,分页,排序等组合在一起。我相信的动机纯粹是基于金钱和时间。


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.

然而,我不认为沙子中的这条线是一个很好的线。我知道有一些网站我使用WebForms需要大量的头发拉动,如果我使用MVC就不会发生这种情况。但我也有一些不需要灵活性的网站,所以我使用了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...

我在ASP.NET MVC中看到的最大优势是AJAX。在使用MVC而不是WebForms时,我更容易处理jQuery AJAX请求。我也是一个控制狂,所以使用MVC也满足了这个方面......

#2


4  

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

位置不是很重要,正在解释的是典型的Intranet网站具有以下属性:

  • Very low user load, usually served on internal LAN
  • 用户负载非常低,通常在内部LAN上提供
  • Very short development schedules
  • 非常短的开发时间表
  • Very frequency "feature additions" that consist of CRUD add ons
  • 非常频率的“功能添加”,包括CRUD附加功能

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

因此,使用MVC进行开发可能会过度,而不是使用WebForms拼凑一些内容。

#3


4  

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.

IM(非常)HO使用当前版本的MVC构建,例如,与使用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).

但是,如果网站更关注向最终用户呈现内容(典型的网站:博客,电子商务应用程序,门户网站),MVC提供了许多优于WebForms的优势。通常这类网站更关注表现问题(如果过度依赖WebForms服务器控件进行渲染,这可能是一个问题)。

#4


2  

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.

对我而言,ASP.NET Webforms的优势在于您可以比ASP.NET MVC更快地开发它们。成本:很难使它们成为现代CSS兼容应用程序以及Viewstate和页面生命周期的重量。

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

如果您关闭了ASP.NET MVC,则没有理由不将其用于Intranet应用程序。

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

如果您投入了几年时间来减少ASP.NET Webforms,那么您可以将它们用于Internet应用程序。

#5


1  

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.

MVC提供了比webforms更好的关注点分离,然而,它确实带来了一些在较小的项目上难以证明的开销。使用一个模型而不是另一个模型的决定不应该基于它是内部网还是互联网解决方案,而是基于长寿,可维护性和可扩展性等因素。根据我的经验,如果项目很大,拥有庞大而多样化的开发团队并且可能需要进行维护,MVC是一个更好的选择。 Webforms更适合在较小的短期项目中快速开发。

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.

不用说,WebForms可以并且已经用于大型项目,因为MVC可以用于较小的项目。您需要根据项目的需求提高每个方面的好处。

#6


1  

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

干杯

#7


0  

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.

作为其他答案的旁注,在内联网环境中,URL命名约定(即/控制器/方法等)不太重要,因为不需要SEO。