Table of Contents

Class ApplicationBuilderExtensions

Namespace
Htmx.Components
Assembly
Htmx.Components.dll

Extension methods for configuring HTMX Components middleware in the application pipeline.

public static class ApplicationBuilderExtensions
Inheritance
ApplicationBuilderExtensions
Inherited Members

Methods

UseHtmxPageState(IApplicationBuilder)

Adds the HTMX page state middleware to the application pipeline.

public static IApplicationBuilder UseHtmxPageState(this IApplicationBuilder app)

Parameters

app IApplicationBuilder

The application builder.

Returns

IApplicationBuilder

The application builder for method chaining.

Examples

app.UseHtmxPageState();
app.UseAuthentication();
app.UseAuthorization();
app.MapControllers();

Remarks

This middleware must be added to the pipeline to enable page state functionality. It should be added early in the pipeline, typically before authentication and authorization middleware.

Exceptions

ArgumentNullException

Thrown when app is null.