-1
我有組合1,其含有量和組合2包含在組合1中選擇如何可以在用戶改變組合1填充組合
組合1個後置組合2的值的最大值:
@Html.DropDownListFor(model => model.QtiteToBuy, new SelectList(
new List<Object>{
new { value = 0 , text = "0"},
new { value = 1 , text = "1"},
new { value = 2 , text = "2"},
new { value = 3 , text = "3"},
new { value = 4 , text = "4"},
new { value = 5 , text = "5"},
new { value = 6 , text = "6"},
new { value = 7 , text = "7"},
new { value = 8 , text = "8"},
new { value = 9 , text = "9"}
}, "value", "text"))
如果用戶選擇COMBO1 = 4,我應該在組合2 0〜4
需要Javascript/jQuery來給客戶端的變化。做一些研究。你的代碼可以是'@ Html.DropDownListFor(m => m .QtiteToBuy,new SelectList(Enumerable.Range(0,10)))' –