I have to make an AJAX call on the onchange event of a dropdownlist which is part of a view. On the change event i need to call the database, do some calculations display th
Here is a general idea how you'd implement this.
<%= Html.RenderPartial("MyPartialView", Model) %>
Here is your controller action method.
[HttpPost]
public PartialViewResult GetPartialGraph(int id /* drop down value */)
{
// do calculations whatever you need to do
// instantiate Model object
var model = myBusinessLogicService.DoCalculations(id);
return PartialView("MyPartialView", model);
}
I think this is the answer you are looking for.