Merge pull request #3938 from zyhfish/task/fix-pr-3927

Fix #3927: change to async method to avoid the exception.
This commit is contained in:
Shaun Walker 2024-03-04 07:49:11 -05:00 committed by GitHub
commit 99d4d5ed9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,7 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><ModuleTitle /></h5>
<form method="post" class="app-form-inline" @formname="AdminContainerForm" @onsubmit="@CloseModal" data-enhance>
<form method="post" class="app-form-inline" @formname="AdminContainerForm" @onsubmit="@(async () => await CloseModal())" data-enhance>
<input type="hidden" name="__RequestVerificationToken" value="@SiteState.AntiForgeryToken" />
<button type="submit" class="btn-close" aria-label="Close"></button>
</form>
@ -22,9 +22,9 @@
</div>
@code {
private void CloseModal()
{
NavigationManager.NavigateTo((!string.IsNullOrEmpty(PageState.ReturnUrl)) ? PageState.ReturnUrl : NavigateUrl());
private async Task CloseModal()
{
NavigationManager.NavigateTo((!string.IsNullOrEmpty(PageState.ReturnUrl)) ? PageState.ReturnUrl : NavigateUrl());
}
}