我有一个接受参数的剃刀组件页面。
@page "/Customer/{CustomerId:int}"
现在我正在检查方法onParameteRSSetAsync(如果customerId存在)。如果不存在,我想显示/触发404异常。
有没有简单的方法可以做到这一点?
我认为您将必须创建自己的404页面并使用NavigationManager将用户重定向到该页面
NavigationManager
NavigationManager.NavigateTo("/404");