ASP.NET Core + HTMX
HtmxToolkit guides
Load HTML fragments, submit forms, and update your pages with HTMX and ASP.NET Core.
Choose a path below. For individual types and members, use the API reference.
New to HTMX? Read the short Overview first. Then build one Razor Pages application through three tutorials, with each step building on the previous one:
- Getting started: load product details into the page.
- Forms, validation, and events: save a profile and refresh its summary.
- Loading states and request errors: show progress and recover from failed requests.
For another application style, use the complete MVC or Minimal API example. For an existing integration, browse the task guides below or run the demo.
Start here
Concept
Overview
Understand what the toolkit provides and where HTMX itself fits.
Tutorial
Getting started
Build a working interaction from installation through a server-rendered fragment.
Decision
Choose an HTMX version
Target the correct markup for HTMX 1.x, 2.x, or 4.x.
Build an integration
Forms, validation, and eventsBuild a complete form that saves, shows errors, and refreshes another component.
Loading states and request errorsShow a loading message, disable repeated clicks, and recover from failed requests.
Full pages and fragmentsSupport normal navigation and HTMX from the same application.
Read HTMX requestsDetect requests, inspect typed headers, and select MVC actions.
Control HTMX responsesChoose targets, swaps, navigation, history, and client events.
Use Tag HelpersGenerate URLs, values, headers, and request options from Razor.
Configure and operate
Application configurationRender strongly typed global settings for the selected version.
Version compatibilityCompare requests, configuration, events, and swaps across releases.
Antiforgery and Toolkit scriptSend tokens, enable server validation, and see what the Toolkit script does.
Static assets and deploymentLoad the Toolkit script, configure caching, and publish the application.
Common recipesImplement validation, polling, redirects, and cross-component updates.
TroubleshootingDiagnose failures from generated markup and browser network data.
Tip
If an application already uses HTMX, begin with Choose an HTMX version, then add only the toolkit features it needs.