Utilizing ASP MVC4 with Razor2, my goal is to utilize Javascript to fetch JSON data and choose which property to display. Each thread has its own JSON file, and I am showcasing 15 threads at a time. To streamline page load times, I need to retrieve the data incrementally rather than all at once. Since the data is non-sensitive, client-side processing seems appropriate.
Below is the code snippet:
public static PagedList<PiFDetailsModel> GetPagedThreads(int skip, int take)
{
// Code logic here...
}
[OutputCache(Duration = 60 * 5)]
public static dynamic GetThreadInfo(string thingID)
{
// Code logic here...
}
Index:
@foreach (var item in Model)
{
<div class="pif">
// Code logic for displaying thread details...
</div>
}
I've searched for examples but haven't found exactly what I need. I believe using JavaScript, possibly JQuery, is the solution. As a newcomer to web development, any detailed example would be greatly appreciated. The project is open source on GitHub, so feel free to fork it for collaboration: https://github.com/sevenalive/PlayItForward