Skip to main content

Extract Partial View (MVC)

Extracts the selected code to create a new editor template.

#Availability

Available from the context menu or via shortcuts:

  • when the part of an MVC view code is selected.

#Examples

<!--Index.cshtml-->
<div>
  @Html.Label(Model.UserName)
</div>
<div>
  @Html.EditorFor(m => m.Password)
</div>

Result:

<!--Index.cshtml-->
@Html.Partial("PartialView0")

#Screenshot

CSharpExtractPartialView