繁体   English   中英

Blazor 服务器的路由参数

[英]Routing parameter with blazor server

@page "/customer"
@page "/customer/{id:int}"//work
@page "/customer/{BigId:Int64}"//not work



@code {

[Parameter]
public int? id { get; set; }//work

[Parameter]
public Int64? BigId { get; set; }//not work
}

错误:System.NullReferenceException:对象引用未设置为对象的实例。 在 Microsoft.AspNetCore.Components.Routing.Router.Refresh(Boolean isNavigationIntercepted) 在 Microsoft.AspNetCore.Components.Routing.Router.SetParametersAsync(ParameterView 参数)

我向您推荐有关路线上允许的限制的Ms-Docs 文档 在此处输入图像描述

Int64是一个long

@page "/customer/{BigId:long}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM