【问题标题】:How to write multiple RouteValues?如何编写多个 RouteValues?
【发布时间】:2019-08-21 07:47:19
【问题描述】:

我的视图页面上有 3 个搜索过滤器,因此在转到另一个页面时需要将参数值传递给查询。我已经通过这个 RouteValue = new KeyValue

问题是我不知道如何添加多个参数,除了statistics_entity我还有两个

@await Component.InvokeAsync("PaginatorComponent", 
                            new 
                            { 
                                Module = "EsahsUsers", 
                                Page = "Index", 
                                HasPreviousPage = Model.HasPreviousPage, 
                                PageNumber = Model.PageNumber, 
                                PageCount  = Model.PageCount, 
                                RouteValue = new KeyValuePair<string, string>("Statistical_Entity", Context.Request.Query["Statistical_Entity"])
                            })

【问题讨论】:

    标签: c# asp.net-core pagedlist


    【解决方案1】:

    试试这个

    RouteValue = new List<KeyValuePair<string, string>>() { new KeyValuePair<string, string>("", ""), new KeyValuePair<string, string>("", "") }
    

    【讨论】:

    • 处理请求时发生未处理的异常。 InvalidCastException:指定的强制转换无效。 lambda_method(闭包,对象,对象[])
    • 在组件方面你传递了什么?
    • List?> routeValue pagingConfig.RouteValue = routeValue; public List?> RouteValue { get;放; }
    • 那么 routeValue 的值是多少?
    • 空。应该是什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-05-05
    • 2014-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-11
    • 2016-08-30
    相关资源
    最近更新 更多