avoid redirect to home page when switching language.

This commit is contained in:
Ben 2024-04-25 23:18:17 +08:00
parent bfa891f0ca
commit ec994b3e97

View File

@ -18,7 +18,7 @@
{ {
@if (PageState.RenderMode == RenderModes.Interactive) @if (PageState.RenderMode == RenderModes.Interactive)
{ {
<a class="dropdown-item @(CultureInfo.CurrentUICulture.Name == culture.Name ? "active" : String.Empty)" href="#" @onclick="@(async e => await SetCultureAsync(culture.Name))">@culture.DisplayName</a> <a class="dropdown-item @(CultureInfo.CurrentUICulture.Name == culture.Name ? "active" : String.Empty)" href="#" @onclick="@(async e => await SetCultureAsync(culture.Name))" @onclick:preventDefault="true">@culture.DisplayName</a>
} }
else else
{ {