且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将ASP.NET网站改为ASP MVC5?

更新时间:2022-10-18 19:32:14

您要问的是,真正的目标是使用MVC来使用MVC。是的,它可以提高项目的可维护性和其他品质,但整个方法都是错误的:你需要来自项目本身的目标。



情况如果您尝试创建一些MVC替代品,一些新架构或新框架,那将会非常不同。但您只想使用之前已经为您创建的MVC。所以,也许你应该记住它是真的为你的项目创建的(在许多其他项目中),而不是你的项目是为MVC创建的。



所以,你的问题在某种程度上,以颠倒的方式显示您的一些痕迹。让我们看看:1)它可能是合理的,但它实际上取决于您的项目目标和要求。 2)我不会害怕挑战;当你面对它们时,它会帮助你处理它们;这个问题很奇怪,因为你应该明白我们对你的技能和资源知之甚少。



现在...... 3)浏览器兼容性问题?哦,是的,问题,问题和更多的问题。我会说,它们与MVC本身并没有多大关系,它们更多地是关于CSS和布局,还涉及避免所有非标准或纯粹支持的JavaScript和DOM功能。我的主要想法是:不要试图达到相同的外观;这几乎是不可能的。相反,开发UI设计可以保持您独特的外观和感觉,但对浏览器布局引擎的不同渲染细节不太敏感。请查看我过去的答案:

在不同浏览器中运行时,网页布局会发生变化。 [ ^ ],

如何将桌面版网站转换为移动版网站 [ ^ ]。



... 4)不清楚你的意思;下载MVC框架并阅读要求; 5)是的,但是,这又取决于你的项目(想象如果你的身边只有一页会发生什么:-))。



- SA

I have a web application project in asp.net. I need to convert(revamp) the project to MVC(MVC5).

1. Starting a new MVC project and recreating all the functionalities in the new project - Is this the right approach to do that?

2. What all are the challenges I may have to face?

3. I want the website to give support in most of all browsers and in earlier versions(like IE8 and IE7). Is there any issues for this?

4. Is there any changes required at the production server?

5. Is it possible to partially convert the existing project to MVC and see?

I don't have any prior experience in MVC. Any helpful information regarding this will be highly appreciable. Thanks in Advance!

You are asking as the real goal was to use MVC for the sake of using MVC. Yes, it can improve maintainability of your project and other qualities, but the whole approach is wrong: you need to come from the goals of your project itself.

The situation would be very different if you tried to create some alternative to MVC, some new architecture or a new framework. But you merely want to use MVC which was already created for you before. So, perhaps you should remember that it was really created for your project (among many other ones), not that your project was created for MVC.

So, your questions display some trace of your, in a way, upside-down view. Let's see: 1) It's likely to be reasonable, but it really depends on your project goals and requirements. 2) I would not be afraid of challenges; it would help you to deal them as you face them; this question is weird because you should understand that we know very little about your skills and resources.

Now… 3) issues with browser compatibility? oh yes, issues, issues and more issues. I would say, they are not much related to MVC itself, they are more about CSS and layouts, and also about avoiding all non-standard or purely supported JavaScript and DOM features. My key idea here is: don't try to achieve identical look; this is nearly impossible. Instead, develop UI design which keeps your unique look and feel and yet is not too sensitive to different rendering detail of browsers' layout engines. Please see my past answers:
webpages layout change when running in different browsers.[^],
How Do I Convert Desktop Site Into Mobile Site[^].

… 4) not clear what you mean by that; download the MVC framework and read the requirements; 5) yes, but, again, it depends on your project (imagine what could happen if your side is just one page :-)).

—SA