Hello,
I have buttons where I want to pass Model and other parameters to the Action method of the Controller. Using RouteValueDictionary, it allows me to send only 1 Key-Value pair. How do I add more than 1 Key-Value pair ?
View Code :
-
- @* Using RouteValueDictionary
- new RouteValueDictionary(Model) -- shows result just of page 1, as page value not passed & default is 1
- new RouteValueDictionary ({ mivm = Model, page = Model.CurrentPage + 1}) --- Model is null in Controller Index Action method
-
- button type="button" id="btnNext" class="btn btn-sm" title="Next" onclick="location.href='@Url.Action("Index", "Member", new RouteValueDictionary(new { mivm = Model, page = Model.CurrentPage + 1 })) )'" @( (Model.CurrentPage == Model.TotalPages) ? "disabled" : "")><span class="glyphicon glyphicon-step-forward"></span></button>
- *@
Controller Action Method :
- public ActionResult Index(MemberIndexViewModel mivm, int page = 1, string sort = "", string sortdir = "asc") {
- ........
- }
Where am I going wrong and How to make this working ??
Any help is highly appreciated.
Thanks,