Mọi người cho e hỏi làm sao để truyền được Dropdownlist vào controller để xử lí dữ liệu được chọn
mình có đoạn hiển thị sau:
@Html.DropDownList("dropdownlistDay", new List<SelectListItem>
{
new SelectListItem {Text = "Check In", Value = "1"},
new SelectListItem {Text = "Check Out", Value = "2"},
}, "--- Select ---", new { style = "width:250px ; margin-left:12px;height:30px" })
<button type="submit" class="btn btn-primary">Filter</button>
Controler :mình có Action Index để xử lí mình truyền checkin1,checkin2,SearchString từ VIew lên thì được nhưng chọn là Dropdownlist thì k
public ActionResult Index(string checkin1, string checkin2,DropDownList dropdownlistDay, string SearchString, int page = 1, int pageSize = 10)
{
var dao = new CustomerDao();
var model = dao.ListALlPaging(SearchString, page, pageSize,checkin1,checkin2,dropdownlistDay.SelectedValue);
ViewBag.searchString = SearchString;
return View(model);
}
Thank