[ACCEPTED]-How to navigate to an ASP.NET Core MVC controller in Blazor app?-blazor
Accepted answer
This should do:
@page "/MvcLinkExample"
@inject NavigationManager NavigationManager
<button @onclick="NavigateToMvcPage">MVC Link</button>
@code {
private void NavigateToMvcPage()
{
NavigationManager.NavigateTo("controllername/actionname/10", true);
}
}
0
MVC uses "routes" to configure endpoints 6 (Controller / Action / Area) mappings.
In 5 the example you provided, the route would 4 resolve to http(s)://[hostname or ip]/Download/DownloadFile/.
With 3 the "default route", the 'key' query string 2 param can be provided via ?key=[value-xxx] as 1 a basic implementation.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.