Blazor - Save result of razor component to a string #29648
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
question
Status: Resolved
Is your feature request related to a problem? Please describe.
Sometimes I have to pass HTML to JavaScript to use it in a JavaScript-enhanced element (Bootstrap "plugin"). It would be useful to be able to reuse an existing razor component by saving the output it would render to a string and passing it on to JavaScript.
Describe the solution you'd like
Given a component MyComponent.razor:
Save its output to a string and use like:
The text was updated successfully, but these errors were encountered: