JetBrains Rider 2021.1 Help

Predefined Surround Templates for ASP.NET(C#)

This topic lists all predefined surround templates for ASP.NET(C#) in JetBrains Rider 2021.1. For more information about surround templates, see Surround Code Fragments with Templates

TemplateDetails
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)

  • TYPE- Suggest type for a new variable declared in the template

  • VARIABLE- When executed in variable declaration (where variable name should stand), suggests name for the variable.

  • SELECTION- The text selected by the user before invoking the template.

  • END- The caret position after the template is applied.

Before expansion

JetBrains Rider: Live templates
After expansion
JetBrains Rider: Live templates

Last modified: 12 July 2021