迁移经典ASP - Web表单或ASP.NET MVC? [英] Migrating Classic ASP - Webforms or ASP.NET MVC?

查看:203
本文介绍了迁移经典ASP - Web表单或ASP.NET MVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个传统的ASP应用程序为我的客户一些维护,并作为我期待通过ASP,以下问题想到的 - 它会更容易为传统的ASP应用程序转换为ASP.NET MVC或ASP.NET WebForms的?

I'm doing some maintenance on a classic ASP application for my client, and as I'm looking through the ASP, the following question comes to mind - would it be easier to convert a classic ASP app to ASP.NET MVC or ASP.NET WebForms?

在很多方面,它似乎至少有ASP的HTML可能更容易转化为MVC比起来,撕裂了HTML块,并把它们变成ASP.NET控件,中继器,数据网格,等有加在处理和ViewState的逻辑等添加可能会增加的工作。

In many ways, it appears that at least the HTML of ASP might be easier to convert to MVC than it would be to rip out the HTML chunks and turn them into ASP.NET controls, repeaters, datagrids, etc. Plus having to add in handling and logic for ViewState, etc. might be added work.

我不认为我的客户端将被要求像这样的任何升级,所以这只是理论上的。

I don't think my client will be requesting any upgrade like this, so this is just theoretical.

让我们假设这个ASP code被写入很好(这并不总是当然是真的),所以真正的问题是,一个病例 - 精心设计的最好的ASP网站MVC迁移比的WebForms?

Let's assume that this ASP code is written very well (which isn't always true of course) so really the question is, will a best-case-well-designed ASP site migrate better to MVC than WebForms?

(请注意,我是很新的ASP.NET MVC,所以我可能会丢失一些东西在这里至关重要)。

(Note that I'm very new to ASP.NET MVC, so I might be missing something crucial here).

推荐答案

这取决于传统的ASP应用程序是如何组织了不少。

It depends a lot on how the classic asp app is structured.

与HTML混合服务器标记类似于asp.net mvc的,但MVC是不是凌乱(或不应该)。你也许能够在传统的ASP presentation code移动到一个MVC视图,而不是一个Web表单更容易。同时传统的ASP应用程序通常是在考虑网络的无国籍发展。有可能是不是在你的传统ASP匹配postabacks或任何视图状态。经典ASP还使用而不是asp.net Web窗体控件普通HTML元素。在这些方面它匹配MVC比的WebForms更近了很多。

The server tag mixed in with HTML is similar to asp.net mvc but MVC is not as messy (or not supposed to be). You might be able to move the classic asp presentation code to a MVC view easier than to a web form. Also classic asp apps were usually developed with the statelessness of the web in mind. There probably is not anything in your classic asp that matches postabacks or viewstate. Classic ASP also uses normal html elements as opposed to asp.net webform controls. In these respects it matches MVC a lot closer than webforms.

如果您不知道asp.net web表单或asp.net的MVC我会说MVC是要走的路。

If you do not know asp.net webforms or asp.net mvc I would say MVC is the way to go.

如果你知道的WebForms非常好,不知道很多有关MVC我想说的WebForms是要走的路。

If you know webforms very well and don't know much about MVC I would say webforms is the way to go.

但是,如果您由于某种原因,客户端不想要的网站的重建,我会说去与MVC。它总是很高兴有你的经验发展的一部分客户付费,只要你能提供。

But, if your client for some reason does want a redevelopment of the site I would say go with MVC. It's always nice to have a client pay for part of your experience development as long as you can deliver.

在另一方面,我总是吃了一惊,当我遇到谁希望我做他们的传统的ASP网站工作的客户端。在每一个情况下,该网站是一个烂摊子。更糟的部分是,他们通常是充满了巨大的安全漏洞。

On another note I'm always taken aback when I come across a client who wants me to do work on their classic asp site. In every single case the site is a mess. The worse part is that they are usually filled with huge security holes.

这篇关于迁移经典ASP - Web表单或ASP.NET MVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆