Hi,
does anyone know how to use localizer instance within <label> tag? I tried this, but it doesn't work properly:
<div class="form-group"> <label asp-for="@localizer["Year"]" class="control-label"></label> <input asp-for="@localizer["Year"]" class="form-control" /> <span asp-validation-for="@localizer["Year"]" class="text-danger"> </div>
Here is the code:
@inject Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer localizer @{ ViewData["Title"] = "Create"; } <div class="form-group"> <label asp-for="" class="control-label"></label> <input asp-for="" class="form-control" /> <span asp-validation-for="" class="text-danger"></span> </div>