# Using the fetch API

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.

![Cheat sheet: Using the fetch API](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/250f297d325c4cb0bd97a60ce1297a6e.webp)

- Category: JavaScript
- Level: Journeyman
- Tags: aspnet-core, Custom data attribute, Event Bubbling, Event Delegation, JavaScript
- Updated: November 3, 2026

Source: https://www.ask-codey.com/cheat-sheets/mvc-partials-with-fetch-using-the-fetch-api-cheat-sheet
