-
Notifications
You must be signed in to change notification settings - Fork 215
Open
Labels
area-compilerUmbrella for all compiler issuesUmbrella for all compiler issuesfeature requestLarge improvement requestLarge improvement request
Milestone
Description
In .NET 8 RC2 we introduced some new attributes that Blazor users can use to control enhanced navigation and form handling:
-
data-enhance-nav
: Used to turn off enhanced navigation for a specific link or DOM subtree<a href="my-non-blazor-page" data-enhance-nav="false">My Non-Blazor Page</a>
-
data-enhance
: Used to opt in to enhanced form handling for a form element:<form method="post" @onsubmit="() => submitted = true" @formname="name" data-enhance> <AntiforgeryToken /> <InputText @bind-Value="Name" /> <button>Submit</button> </form> @if (submitted) { <p>Hello @Name!</p> } @code{ bool submitted; [SupplyParameterFromForm] public string Name { get; set; } = ""; }
-
data-permanent
: Used to signal that an element add or updated dynamically should be preserved when handling an enhanced navigation of form request:<div data-permanent> This div gets updated dynamically by a script when the page loads! </div>
We should update the Razor tooling to provide appropriate completions and diagnostic for these attributes.
Related PRs:
nicolassargos, LuohuaRain and AvengedCopilot
Metadata
Metadata
Assignees
Labels
area-compilerUmbrella for all compiler issuesUmbrella for all compiler issuesfeature requestLarge improvement requestLarge improvement request