I'm trying to call the action in the controller when the dropdown selected item changes. Here is the code I am using but it is not working.
@Html.DropDownList("UserID", null, new { @onchange = "location.href='@Url.Action("Action", "Controller")'" })
What is the correct syntax? I tried to call a javascript function and it works.
@Html.DropDownList("UserID", null, new { @onchange = "leaveChange(this);" })
leaveChange(control) is my javascript function.
However, I am unable to invoke the action of the controller. Also, How do I then pass the value of the selected item to the action?