I am trying to provide a link to filter search results.
<%= Html.ActionLink("Filter Results", "Index", new { page = Model.RestaurantList.PageIndex(), searchText = Model.SearchText, useFilter = true, filterOption = Model.FilterOption, filterText = Model.FilterText }, null)%>
The controller definition is as such
public ActionResult Index(int? page, string searchText, bool useFilter, string filterText, string filterOption)
However when I debug this the values are not set properly, even the useFilter variable.
My link is rendered localhost/home/index/true?page=0
Any ideas how to fix this?
The code segment looks fine. I think there are 2 possible errors:
routes.MapRoute(…) calls in
global.ascx.cs/vb file to make sure
a route for Home#Index action is
properly configured
If you still can’t make it to work, you might want to post more info (like route mapping code, name of view/controller)