I am developing a website using ASP.NET MVC 3.
I have a number of sections containing news from different departments, as shown in the picture below:
https://i.stack.imgur.com/G21qi.png
The sections are added to the masterpage by using
@Html.Action("_News", "Home", new { id = 1 })
Where id 1 = "Ledelsen", 2 = "Omstillingen" and so on.
My Controller contains the following Action:
[ChildActionOnly]
public ActionResult _News(int id)
{
// controller logic to fetch correct data from database
return PartialView();
}
I got CRUD up and running, but my question is how I can refresh the PartialViews without postback, at a set interval?
I'm guessing I have to use Javascript/jQuery to accomplish this, but I have not been able to.
Can anyone point me in the right direction or better yet, provide an example of how to do this?
Thanks in advance
EDIT: Just to clarify I do not want the whole page to refresh, but only do an asynchronous refresh of the partialviews