ReSharper 2016.3 Help

Predefined Live Templates for ASP.NET

ReSharper | Templates Explorer | Live Templates | ASP.NET

This topic lists all predefined live templates for ASP.NET in ReSharper 2016.3.1. For more information about live templates, see Creating Source Code Using Live Templates

TemplateDetails
ctx

Current file context

Scope everywhere

Body

$CTX$

Parameters

  • CTX - Provides list of items describing current context. This includes file name, containing type name, namespace name, etc. (context)
nguid

Insert new GUID

Scope everywhere

Body

$GUID$

Parameters

  • GUID - Generates new Globally Unique Identifier (GUID) (guid)
<script

Create script tag

Scope HTML and similar tags

Body

<script type="$attributeValue$">$END$</script>

Parameters

  • attributeValue - Suggest attribute value for current html tag attribute (suggestAttributeValue)
  • END - The caret position after the template is applied.
t

Create ASP.NET tag

Scope ASP.NET tags

Body

<$TAG$ $RUNATSERVER$>$END$</$TAG$>

Parameters

  • TAG - Suggest tag name used in current document (suggestTagName)
  • RUNATSERVER - Insert runat="server" if server-side tag selected (runAtServer)
  • END - The caret position after the template is applied.

Before expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Live_Templates__Predefined__ASP.NET__t__before.png

After expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Live_Templates__Predefined__ASP.NET__t__after.png

tc

Create closed tag

Scope ASP.NET tags

Body

<$TAG$ $RUNATSERVER$$END$/>

Parameters

  • TAG - Suggest tag name used in current document (suggestTagName)
  • RUNATSERVER - Insert runat="server" if server-side tag selected (runAtServer)
  • END - The caret position after the template is applied.

Before expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Live_Templates__Predefined__ASP.NET__tc__before.png

After expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Live_Templates__Predefined__ASP.NET__tc__after.png

a

Create tag attribute

Scope HTML and similar attributes

Body

$ATTR$="$END$"

Parameters

  • ATTR - Suggests attribute name used in the same tags in current document (suggestAttributeNameByTag)
  • END - The caret position after the template is applied.
<asp:HyperLink

ASP.NET Hyperlink

Scope ASP.NET tags

Body

<asp:HyperLink runat="server" NavigateUrl="$LINK$" Text="$TEXT$" />

Parameters

  • LINK - no macro
  • TEXT - no macro

Before expansion

/help/img/dotnet/2016.3/Reference__Options__Templates__Live_Templates__Predefined__ASP.NET__aspHyperLink__before.png

After expansion
/help/img/dotnet/2016.3/Reference__Options__Templates__Live_Templates__Predefined__ASP.NET__aspHyperLink__after.png

foreach

foreach block

Scope ASP.NET tags

Body

<% foreach ($TYPE$ $VARIABLE$ in $COLLECTION$) { %> $SELECTION$ $END$<%}%>

Parameters

  • COLLECTION - Suggests visible variable that can be enumerated (that is, used in foreach loop as collection) (enumerableVariable)
  • TYPE - Suggest type for a new variable declared in the template (suggestVariableType)
  • VARIABLE - When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName)
  • SELECTION - The text selected by the user before invoking the template.
  • END - The caret position after the template is applied.
foreach

For Each block

Scope ASP.NET tags

Body

<%For Each $VAR$ As $TYPE$ In $COL$ %> $SELECTION$ <>

Parameters

  • COL - Suggests visible variable that can be enumerated (that is, used in foreach loop as collection) (enumerableVariable)
  • TYPE - Analyzes code and guesses type of element of a collection. (guessElementType)
  • VAR - When exectuted in variable declaration (where variable name should stand), suggests name for the variable. (suggestVariableName)
  • SELECTION - The text selected by the user before invoking the template.
Last modified: 15 February 2017