Created
March 17, 2017 07:19
-
-
Save tayyebi/d6369e69057767e445335b0bd322bc0b to your computer and use it in GitHub Desktop.
Agian you can have `mvcaction` in any version of Visual Studio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets | |
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>MVC Action</Title> | |
<Author>MohammadReza Tayyebi github.com/tayyebi</Author> | |
<Description>Creats an empty action</Description> | |
<Shortcut>mvcaction</Shortcut> | |
</Header> | |
<Snippet> | |
<Imports> | |
<Import> | |
<Namespace>System.Web.Mvc</Namespace> | |
</Import> | |
</Imports> | |
<Declarations> | |
<Literal> | |
<ID>Action</ID> | |
<ToolTip>Replace with your action name</ToolTip> | |
<Default>Index</Default> | |
</Literal> | |
<!-- | |
<Object> | |
<ID>SqlConnection</ID> | |
<Type>System.Data.SqlClient.SqlConnection</Type> | |
<ToolTip>Replace with a connection object in your application.</ToolTip> | |
<Default>dcConnection</Default> | |
</Object> | |
--> | |
</Declarations> | |
<Code Language="CSharp"> | |
<![CDATA[ | |
public ActionResult $Action$() | |
{ | |
if (Request.IsAjaxRequest()) | |
return PartialView(); | |
return View(); | |
} | |
[HttpPost] | |
public ActionResult $Action$(Guid? id = null) | |
{ | |
if (Request.IsAjaxRequest()) | |
return PartialView(); | |
return View(); | |
} | |
]]> | |
</Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment