I'm trying to call a controller method from a javascript function, I read that it can be used with jquery .ajax. The thing is that I don't want to receive a result, the controller renders a view based on the id that I send via the ajax. I have the following code, but it doesn't do anything...
(This function is called by a flash object)
function display(number) {
$.ajax({
type: "POST",
url: "/Controller/Method",
data: "id=" + number});
}
Here's what the controller's method looks like:
[HttpPost]
public ActionResult Method(int? id) {
object = //do the query.
return View(object);
}