﻿@using System.Globalization
@using Microsoft.AspNetCore.Builder
@using Microsoft.AspNetCore.Http
@using Microsoft.AspNetCore.Localization
@using Microsoft.Extensions.Options

@inject IViewLocalizer Localizer
@inject IOptions<RequestLocalizationOptions> LocOptions

@{
    var cultureItems = new SelectList(LocOptions.Value.SupportedUICultures, nameof(CultureInfo.Name), nameof(CultureInfo.DisplayName));
}

<div>
    <form id="selectLanguage" asp-area="" asp-controller="Home" asp-action="SetLanguage" asp-route-returnUrl="@Context.Request.Path" method="post" class="form-horizontal" role="form">
        @Localizer["Language:"]
        <select name="culture" asp-for="@Context.GetCurrentCulture()" asp-items="cultureItems"></select>
        <button>OK</button>
    </form>
</div>
﻿@using System.Globalization
@using Microsoft.AspNetCore.Builder
@using Microsoft.AspNetCore.Http
@using Microsoft.AspNetCore.Localization
@using Microsoft.Extensions.Options

@inject IViewLocalizer Localizer
@inject IOptions<RequestLocalizationOptions> LocOptions

@{
    var cultureItems = new SelectList(LocOptions.Value.SupportedUICultures, nameof(CultureInfo.Name), nameof(CultureInfo.DisplayName));
    var currentCulture = Context.GetCurrentCulture();
}

<div>
    <form id="selectLanguage" asp-area="" asp-controller="Home" asp-action="SetLanguage" asp-route-returnUrl="@Context.Request.Path" method="post" class="form-horizontal" role="form">
        @Localizer["Language:"]
        <select name="culture" asp-for="@currentCulture" asp-items="cultureItems"></select>
        <button>OK</button>
    </form>
</div>
Fix issue with tagHelper that requries field or property to target for
Fix issue with tagHelper that requries field or property to target for
