Menu
  • HOME
  • TAGS

ASP.NET mvc Ajax Helper DropDownListFor send selected item value as parameter to controller

asp.net-mvc-4,asp.net-ajax,value,dropdownlistfor,ajaxhelper

The parameter of you method needs to match the name of the control which is name="Roles" so the method should be public ActionResult test(int? roles) Other potential issues with your code Your controller generates List<SelectListItem> for use by the dropdownlist. There is no need for the unnecessary extra overhead of...

FormCollection parameter is empty while using @Ajax.BeginForm and @Ajax.ActionLink

ajax,asp.net-mvc-4,formcollection,ajaxhelper

From the code, It looks like you don't need a form tag covering your entire html. You can place it in the _Sidebar.cshtml like this. Also replace the action link with a submit button (check below code). @using (Ajax.BeginForm("Results", "Search", null, new AjaxOptions { HttpMethod = "POST", InsertionMode = InsertionMode.Replace,...