ReSharper 2022.3 Help

Predefined Surround Templates for ASP.NET(C#)

This topic lists all predefined surround templates for ASP.NET(C#) in ReSharper 2022.3. For more information about surround templates, see Surround code fragments with templates.




foreach block

Scope ASP.NET tags


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


  • COLLECTION - Suggests a visible variable that can be enumerated (that is, used in a foreach loop as collection)

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

  • VARIABLE - When executed in a variable declaration (where variable name should stand), suggests a 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

ReSharper: Live templates
After expansion
ReSharper: Live templates

Last modified: 28 December 2022