@Html.Raw(Model.html);
Unable to use Html.Raw() in view component.
This div does not load anything form model if i use this in view component.
@Html.Raw(Model.html);
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Naimish MakwanaRank #324 · 7.7K reputationPosted Mar 6, 2023, 5:21 AM EST
Hello Gopi,
@Html.Raw(Model.html); should work if you want to display HTML content from mode.
Please check the .html property value is it returning value or not.
or try below.
Thanks
Naimish Makwana
GopiRank #5,293 · 304 reputationPosted Mar 6, 2023, 5:38 AM EST
It working only if my html content is less. If html has more content then it not loading anything. In console window it shows error like this [net::ERR_CONNECTION_RESET 200 (OK)]
Naimish MakwanaRank #324 · 7.7K reputationPosted Mar 6, 2023, 5:48 AM EST
So its not the issue of @Html.Raw.
In your case, it's possible that the amount of HTML content you're trying to render is causing the server to time out or exceed resource limits, resulting in the connection being reset.
You may try below.
services.Configure(options => { options.MaxRequestBodySize = int.MaxValue; options.MaxRequestBufferSize = int.MaxValue; options.AllowSynchronousIO = true; }); services.Configure(options => { options.Limits.MaxRequestBodySize = int.MaxValue; options.Limits.MaxRequestBufferSize = int.MaxValue; });This will increase the maximum request body size and buffer size and Increase the timeout value for the request for both the IISServer and KestrelServer.
Enable compression to reduce the amount of data being transferred between the server and client.
Thanks
Naimish MakwanaRank #324 · 7.7K reputationPosted Mar 6, 2023, 7:34 AM EST
Hello Gopi,
Its possbile that you model HTML will have some css and style which will impected on existing page.
Thanks
Naimish Makwana
GopiRank #5,293 · 304 reputationPosted Mar 6, 2023, 11:00 PM EST
Yes, my model html has some inline css why it affects existing css. how can i overcome this.