أماني مفيد

أماني مفيد

  • 1.9k
  • 107
  • 3.9k

pass value from view to controller

Jan 20 2021 10:17 AM
i have this dropdown list
  1. @Html.DropDownListFor(model => model.Contant.KEYWORD_NAME, ViewData["KEYWORD_NAME"] as IEnumerable<SelectListItem>, item.SelectedItemType, new { @class = "form-control" })  
and i pass some data to view
  1. @if (Model != null)  
  2. {  
  3. @Html.PagedListPager(Model.Items, page => Url.Action("search"new { page, search = Request.QueryString["search"], KEYWORD_NAME = Request.QueryString["Contant.KEYWORD_NAME"]}),  
  4. new PagedListRenderOptions()  
  5. {  
  6. Display = PagedListDisplayMode.IfNeeded,  
  7. DisplayPageCountAndCurrentLocation = true  
  8. ,  
  9. DisplayItemSliceAndTotal = true  
  10. })  
this is the header for the method
  1. public ActionResult search(int? page, string search, string KEYWORD_NAME)  
i have value for page and search m but for KEYWORD_NAMEits null
 
how i can fix it ?

Answers (5)