简体   繁体   English

Visual Studio中的mvcaction3和mvcaction4代码段之间的区别?

[英]Difference between mvcaction3 and mvcaction4 code snippets in Visual studio?

Both mvcaction3 and mvcaction4 code snippets generate the same action method code as below. mvcaction3和mvcaction4代码段均生成以下相同的操作方法代码。 What is the difference between them. 它们之间有什么区别。 I am referring to the short cut mvcaction3 then double tab. 我指的是快捷方式mvcaction3然后双击。

public ActionResult Action()
{
    return View();
}

Am I missing something? 我想念什么吗?

Press Ctrl+Space, snippets appear. 按Ctrl + Space,将显示摘要。 Select mvcaction3 or mvcaction4 - tab+tab -action method generated. 选择mvcaction3或mvcaction4-tab + tab -action方法生成。 Both the same. 两者都一样。

Go to Add-New Project-Web. 转到“添加新项目Web”。 You will see MVC3 and MVC4 projects. 您将看到MVC3和MVC4项目。 Each MVC framework brings its snippets. 每个MVC框架都有其摘要。 It just happens that they produce the same result. 他们碰巧会产生相同的结果。

These snippets are stored in a file like: 这些片段存储在以下文件中:

C:\\Program Files\\Microsoft ASP.NET\\ASP.NET MVC 4\\Visual Studio 2012\\Snippets\\VC#\\1033\\ASP.NET MVC 4\\mvcaction.snippet for MVC4 and C:\\Program Files\\Microsoft ASP.NET\\ASP.NET MVC 4\\Visual Studio 2012\\Snippets\\VC#\\1033\\ASP.NET MVC 4\\mvcaction.snippet for MVC4 and

C:\\Program Files\\Microsoft ASP.NET\\ASP.NET MVC 3\\Visual Studio 2012\\Snippets\\VC#\\1033\\ASP.NET MVC 3\\mvcaction.snippet for MVC3. C:\\Program Files\\Microsoft ASP.NET\\ASP.NET MVC 3\\Visual Studio 2012\\Snippets\\VC#\\1033\\ASP.NET MVC 3\\mvcaction.snippet for MVC3。

These can be modified(if you want to). 这些可以修改(如果需要)。 But by default they both are the same. 但是默认情况下,它们是相同的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM