Matthew Layton
Matthew Layton

Reputation: 42390

Razor Tag Helpers In Pre-ASP.NET Core MVC Applications

In ASP.NET Core there is a new feature called "tag helpers", where I can replace my razor syntax

@Html.TextBoxFor(o => o.FirstName, new { @class = "form-control" })

with something a bit more natural

<input type="text" asp-for="FirstName" class="form-control" />

Upvotes: 1

Views: 373

Answers (1)

Clint B
Clint B

Reputation: 4710

Tag helpers live in the Microsoft.AspNetCore.Mvc namespace which replaces the System.Web.Mvc namespace used in earlier versions of ASP.NET.

So it is not available in Pre-ASP.NET Core versions. And I seriously doubt it ever will be. Microsoft would have to go back and make serious changes to System.Web.Mvc. They've stated many times that they are moving away from System.Web.

Upvotes: 5

Related Questions