我当前的项目中有多个工作示例,这些示例从url检索1个查询参数,但是当尝试对多个url参数遵循相同的约定时,我在chrome调试器控制台中收到以下错误:
I have multiple working examples in my current project of retrieving 1 query parameter from the url however when trying to follow the same convention for multiple url params, I'm receiving the following error in the chrome debugger console:
Error: System.InvalidOperationException: 'Router' cannot find any component with a route for '/confirmemail'.我的页面路线定义为:
@page "/confirmemail/{Token}/{UserId}"和 @functions {...} 部分包含以下属性:
[Parameter] string Token { get; set; } [Parameter] string UserId { get; set; }我正在尝试检索如下所示网址的查询字符串参数:
I am trying to retrieve the query string parameters for a url that looks like this:
http:// localhost:50466 / confirmemail?Token = SomeReallyLargeToken& UserId = SomeGuidUserId
如何实现?
推荐答案您可以尝试吗?
localhost:50466/confirmemail/SomeReallyLargeToken/SomeGuidUserId我认为应该可以。
更新:如果您想从查询参数中精确获取值,请参见以下示例: learn-blazor/pages/router/
UPDATE: If you want to get values exactly from query parameters good example is here learn-blazor/pages/router/
更多推荐
Blazor路由中的多个查询字符串参数
发布评论