i’m doing something like this in category.cshtml view page
<select onchange="location = this.value;">
<option value="/product/categoryByPage/id=@Model.CategoryID,limit=15" selected="selected">15</option>
<option value="/product/categoryByPage/id=@Model.CategoryID,limit=30"
selected="selected">30</option>
<option value="/product/categoryByPage/id=@Model.CategoryID,limit=50"
selected="selected">50</option>
</select>
and from controller :
[ActionName("categoryByPage")]
public ViewResult Category(Guid id, string limit)
{
Category cat = db.Categories.Find(id);
return View(cat);
}
but it isn’t working and controller method unable to fetch that parameters …
thanks in advance,
Milan
you need to change your url as follows to work with default routing:
Note that id is actually in the default route as the last argument, any extra parameters you need need to be provided in query string format