In my MVC application, I have html.dropdownlist in my opinion. When choosing a change - I want the value to be passed to the method (which returns something like a list or JsonResult) in the controller.
Q1: How to do it?
<%=Html.DropDownList("title", Model.Titleitems, "" )%>
Q2: Is this good practice (with the name of the controller / method in the view directly) or do I need to write a JavaScript function and call the appropriate controller / method from this JavaScript function? In this case, how can I write an Onchange or OnSelectionChanged event for the above html.dropdownlist control?
EDIT:
par1 is the selected dropdown value that I want to pass to this controller / method.
public ActionResult GetMethod(string Par1)
{
return Json(varValue, JsonRequestBehavior.AllowGet);
}
, JavaScript ( marteljn) JavaScript, URL-, URL-, .., /; , ?