我正在尝试提供一个链接来过滤搜索结果。
<%= Html.ActionLink("Filter Results", "Index", new { page = Model.RestaurantList.PageIndex(), searchText = Model.SearchText, useFilter = true, filterOption = Model.FilterOption, filterText = Model.FilterText }, null)%>
控制器定义是这样的
public ActionResult Index(int? page, string searchText, bool useFilter, string filterText, string filterOption)
但是,当我调试这个值时,即使是 useFilter 变量也没有正确设置。
我的链接呈现为 localhost/home/index/true?page=0
任何想法如何解决这一问题?