Automatically navigate back to servers page after submitting form for editing server.
With dependancy injection of the NavigationManager.
This commit is contained in:
parent
353df277e5
commit
6090fea796
@ -1,6 +1,8 @@
|
|||||||
@page "/servers/{id:int}"
|
@page "/servers/{id:int}"
|
||||||
@* Route constraints: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-9.0#route-constraints *@
|
@* Route constraints: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-9.0#route-constraints *@
|
||||||
|
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
<h3>Edit server</h3>
|
<h3>Edit server</h3>
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
@ -67,5 +69,7 @@
|
|||||||
{
|
{
|
||||||
ServersRepository.UpdateServer(server.Id, server);
|
ServersRepository.UpdateServer(server.Id, server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NavigationManager.NavigateTo("/servers");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user