0
我有一個控制器「myController的」,有一個叫「printDetails(字符串ID)」 功能我有一個調用參數添加到html.actionlink
@Model.myControllers
//I output files here and user can download to a file, or by selecting an item from the drop down menu and pass it to the function "printDetails"
html.actionlink("download","printDetails")
html.dropdownlist("fromdb",null,"--select--", new{onchange="myJSFunction(fromdb)"})
<script>
myJSFunction(fromdb)
{
//how do i pass "fromdb" as a paramenter to "printDetails?id=fromdb" //myController/printDetails
}
</script>
感謝所有響應的視圖。
優秀的,我可以做到這一點簡單的JS,不知何故未啓用jQuery的運行對我和我沒有時間去找出原因:( – NULL
好它現在做 –
涼,所以在我的控制器做printDetails(串ID)會知道是ID從DB?涼。謝謝。 – NULL