Merge pull request #4195 from zyhfish/task/fix-language-switch-redirect-issue

avoid redirect to home page when switching language.
This commit is contained in:
Shaun Walker 2024-04-26 13:25:48 -04:00 committed by GitHub
commit 4ac4c69820
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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
{ {