在MVC VS 2013中创建新项目时MVC中的webforms [英] webforms in MVC when new project is create in MVC VS 2013

查看:65
本文介绍了在MVC VS 2013中创建新项目时MVC中的webforms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是MVC的新手,我打开了新项目select wed => webapplication => mvc5

然后打开新窗口,这是选择模板然后我选择MVC

新项目开放但是

1)它没有要求使用aspx engin或razor引擎直接用于剃须刀引擎?(因为它在2012年要求使用aspx或剃须刀)



2)当我们添加webforms时,它还会在.cs文件后面添加代码,因此它允许在前端和代码之间紧密耦合来打破分离规则?



3)或者我们能够使用.cs添加webforms然后可以直接将现有的webform项目webforms添加到mvc应用程序吗?并将webform应用程序设为mvc(可能很傻)?





提前感谢。

解决方案

如果您正在使用mvc,那么您也不使用webforms,您要么创建一个mvc项目并使用controllers \ model \ views,要么使用一个带有aspx \ code-behind文件的webforms项目

I am new in MVC, I opened new project select wed=>webapplication=>mvc5
then new window open which is select template then I select MVC
new project opened but
1) it doesn't ask for aspx engin or razor engine it is directly go for razor engine?(because it ask in 2012 for aspx or razor)

2)when we add webforms it also add code behind .cs file , hence it is break the rule of separation by allowing tightly couple between frontend and code behind?

3)OR we able to add webforms with .cs then is it possible directly add existing webform project webforms to mvc application? and make webform application as mvc(may be silly)?


thanks in advance.

解决方案

If you are using mvc then you don't use webforms as well, you either create an mvc project and use controllers\models\views, or a webforms one with aspx\code-behind files.


这篇关于在MVC VS 2013中创建新项目时MVC中的webforms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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