asp.net-coreintellisense

Intellisense for asp-controller or asp-action in ASP.NET Core MVC


I have just installed latest version of VS 2017 with asp.net core 2. The tag helpers intellisense works for asp-for="FirstName" (where FirstName is a property of my Model), but it does not work for something like asp-controller ="..." or asp-action="...".

Is there any way (for example an Extension) to provide intellisense for controller/action... names to avoid manual typing of them?

Update (More info):

for example, if you have a model named Customer as:

public class Customer
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public int Code { get; set; }
}

and following razor code in your Index.cshtml:

@{ var myVar = "abc";}
<input type="text" asp-for="@myVar" />

<label asp-for="FirstName">Name:</label>
<input type="text" asp-for="FirstName" />

<a asp-controller="Home" asp-action="About">About</a>

you will have intellisense for FirstName in asp-for="Firs...", but not for similar properties asp-controller="Hom... or asp-action="Abou..." while both of them are purple and bold (as TagHelpers).


Solution

  • It is not possible, essentially because finding controllers - and, therefore, actions - is tricky. A controller can be a lot of things: