Skip to content

tag-helpers: generate HTMX request URLs from asp-* attributes - #106

Merged
rameel merged 1 commit into
mainfrom
url-tag-helper-asp-attributes
Oct 26, 2026
Merged

rameel merged 1 commit into
mainfrom
url-tag-helper-asp-attributes

Conversation

@rameel

@rameel rameel commented Oct 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

HTMX 4 defines its own hx-action attribute for the request URL, so the
URL Tag Helper turned native markup such as
<button hx-action="/api/users" hx-method="post"> into a GET request to
an MVC action named "/api/users".

Read the standard asp-* routing attributes instead of the hx-* copies.
The Tag Helper now applies only to an element that has an hx-get,
hx-post, hx-put, hx-patch, hx-delete, or HTMX 4 hx-action attribute
written without a value and at least one asp-* routing attribute. It
throws if that attribute has any value, even an empty one, or if
hx-action is used with HTMX 1.9.x or 2.x. It no longer adds hx-get when
no request attribute is present.
@rameel
rameel merged commit 992411f into main Oct 26, 2026
1 check passed
@rameel
rameel deleted the url-tag-helper-asp-attributes branch October 26, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant