Aspnetcore: Enable MVC Views/Pages to invoke a Component as a TAG

Created on 3 Jan 2019  路  4Comments  路  Source: dotnet/aspnetcore

We want to support views/pages using components using the normal element syntax. This is an upgrade over the current support for using HtmlHelper to invoke a component.

We need to do significant design and scoping work here to figure out the limitations and caveats of enabling this.

Components Big Rock Design XL affected-few area-blazor enhancement not-on-roadmap severity-nice-to-have

Most helpful comment

@rynowak I managed to get RC working in MVC Views but had to update the components.server.js file a bit. repo here

I cant wait for this to be fully integrated into MVC so i dont have to map RC components to random HTML tags. Might need to do a Prefix though since you could have a Component named to a current standard html tag like button

All 4 comments

Not sure why this is still open.
@rynowak is this not the HtmlHelper extensions or is this meant to be deeper integration, like calling a component as a tag from a view/page.

This should track using components AS TAGS from views. Updating the main post.

@rynowak I managed to get RC working in MVC Views but had to update the components.server.js file a bit. repo here

I cant wait for this to be fully integrated into MVC so i dont have to map RC components to random HTML tags. Might need to do a Prefix though since you could have a Component named to a current standard html tag like button

We do now support the <component> tag helper (both for rendering server-executed and client-executed components as of .NET 5).

If the original suggestion was to support using components directly (e.g., <MyComponent /> inside a .cshtml file), it's not something on the roadmap currently due to high cost (e.g., with nested child content, it completely changes the meaning of .cshtml syntax) and the fact that it won't make a huge difference over <component>.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

guardrex picture guardrex  路  3Comments

BrennanConroy picture BrennanConroy  路  3Comments

ipinak picture ipinak  路  3Comments

aurokk picture aurokk  路  3Comments

rbanks54 picture rbanks54  路  3Comments