简体   繁体   中英

Difference between mvcaction3 and mvcaction4 code snippets in Visual studio?

Both mvcaction3 and mvcaction4 code snippets generate the same action method code as below. What is the difference between them. I am referring to the short cut mvcaction3 then double tab.

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

Am I missing something?

Press Ctrl+Space, snippets appear. Select mvcaction3 or mvcaction4 - tab+tab -action method generated. Both the same.

Go to Add-New Project-Web. You will see MVC3 and MVC4 projects. Each MVC framework brings its snippets. 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 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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