MVC Partials with fetch

MVC Partials with fetch: MVC Partials with fetch: an overview, Using the fetch API.

Updated

  1. MVC Partials with fetch: an overview (Journeyman): An MVC page can reload just one part of itself. JavaScript fetches the new part's HTML from an action that returns a partial view, and swaps it in. That's the MVC way to do what an API and JSON do for a JavaScript-built page.
  2. Using the fetch API (Journeyman): Catch the pager's clicks with one listener on the pager, cancel them with preventDefault, fetch the partial's HTML with fetch and response.text, and put it in the page with innerHTML. The links keep working when JavaScript doesn't run.