@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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
GopiPosted Mar 7, 2023, 4:00 AM
Yes, my model html has some inline css why it affects existing css. how can i overcome this.
Naimish MakwanaPosted Mar 6, 2023, 12:34 PM
Hello Gopi,
Its possbile that you model HTML will have some css and style which will impected on existing page.
Thanks
Naimish Makwana
Naimish MakwanaPosted Mar 6, 2023, 10:48 AM
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.
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
GopiPosted Mar 6, 2023, 10:38 AM
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 MakwanaPosted Mar 6, 2023, 10:21 AM
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