How to post multiple select values in MVC 3 with Chosen jquery

how do I post the selected values in MVC 3 using [Chosen][1] jquery plugin. I don't get how to post the values I selected. This is how my code looks so far.. ![my test page][2] Here is my post form with the selectlist and a submit button that posts to my controller. @using (Html.BeginForm("Search", "Home", FormMethod.Post)) {
} This is my model that I'm using. public class CategoryModel { public List Categories { get; set; } public CategoryModel() { Categories = new List(); Category cat = new Category(); cat.Id = 1; cat.Name = "Ekonomi"; Categories.Add(cat); cat = new Category(); cat.Id = 2; cat.Name = "IT"; Categories.Add(cat); cat = new Category(); cat.Id = 3; cat.Name = "Teknik"; Categories.Add(cat); } } public class Category { public int Id { get; set; } public string Name { get; set; } } So how do I retrive the values from the textbox? [1]: http://harvesthq.github.com/chosen/ [2]: http://i.stack.imgur.com/iG7T9.jpg

以上就是How to post multiple select values in MVC 3 with Chosen jquery的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏