Skip to content

Blazor , RenderFragment to Raw Html string #9493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
moataz1991 opened this issue Apr 18, 2019 · 3 comments
Closed

Blazor , RenderFragment to Raw Html string #9493

moataz1991 opened this issue Apr 18, 2019 · 3 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@moataz1991
Copy link

moataz1991 commented Apr 18, 2019

as the question title says
can you add the ability to get raw html from RenderFragment?
maybe something like this
RenderFragment renderFragment; renderFragment.ToRawHtml()
or property saving the rawHtml generated by the renderFragment object ?
with events and everything...
for code-behind purposes
Thanks

@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Apr 18, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Apr 18, 2019
@SteveSandersonMS
Copy link
Member

This isn’t a feature we’re currently planning to have. It would involve having a new way of turning render trees into strings. Bear in mind that render output is not a string for Blazor - it’s a structured tree of elements and attributes.

If this becomes a highly requested feature we’d certainly consider adding infrastructure for this, but if not then we have more highly prioritised things to work on. Hope that makes sense.

Also in general it’s hard to see what the use cases would be for this.

@moataz1991
Copy link
Author

moataz1991 commented Apr 19, 2019

@SteveSandersonMS most use cases when dynamically building view with integration with 3rd party JS libraries , when u simply want to send raw HTML to be inserted as a popup for a marker in map library when already u have ur own library of building blazor component dynamically ;)

thanks

@mkArtakMSFT mkArtakMSFT removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels May 9, 2019
@BrainSlugs83
Copy link

Because you might want to inspect the contents of a render fragment. I think as Blazor gets more attention, this is going to be a feature people want... Can you at least document how the RenderTreeBuilder works so that we can create one that renders the fragment to a string?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

5 participants