I have a view called drawGraph , this is accessed through the controller via;
@Html.ActionLink("DrawGraph", "drawGraph", new {id =item.data})
When i use this link the page loads on a new page (as it would) i would like to display it as a part of the page that the link is on, is there any easy way to achive this?
my controller looks like this;
public ActionResult drawGraph(string data)
{
*Bunch of code
return View(chart);
}
Yes you can, however you need to use Ajax, luckily ASP.NET MVC provides some nice convenience methods like Ajax.ActionLink
Then you need to return a partial view from your action with PartialView:
You should not forget to include the
jquery.unobtrusive-ajax.min.jsin your layout/view in order to the Ajax helpers work.