【问题标题】:Redirection of ID in Html.ActionLinkHtml.ActionLink 中 ID 的重定向
【发布时间】:2013-12-12 18:38:41
【问题描述】:

我有一个问题。因为我正在处理一个 PagedList ,我需要对我的页面的 GridView 进行分页,但是当我按下 Next Button 时。我在空字段中被重定向

这是我的片段:

 @Html.ActionLink("Next >", "UserIndex", new { page = Model.PageNumber + 1, viewEvent = ViewBag.EventId, userId = UserLogInInfoModel.UserId }, null)

我想被重定向到这个:

/User/EventDetails?viewEvent=55&userId=12&page=1

但我被重定向到这个:

/User/EventDetails?page=1

在此先感谢 :)

【问题讨论】:

    标签: c# html asp.net-mvc pagination


    【解决方案1】:

    尝试删除null 参数。

    @Html.ActionLink("Next >", "EventDetails", new { page = Model.PageNumber + 1, viewEvent = ViewBag.EventId, userId = UserLogInInfoModel.UserId })
    

    【讨论】:

    • 相同的结果先生 :( 重定向到不同的页面
    • @RenTao 尝试更新代码,也分享你的RouteConfig.cs内容
    • 我没有 routeConfig.cs
    • @RenTao 它将出现在您的App_Start 文件夹中。
    • 我什至没有在这里看到 App_Start 文件夹
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-27
    相关资源
    最近更新 更多