By: Niraj in csharp Tutorials on 2023年03月29日 [フレーム]
To display the HTML content in your success view after parsing, you can use the Html.Raw method in Razor syntax. Html.Raw method is used to render HTML markup to the page without encoding the markup.
Here's an example of how you can use it in your success view:
@model YourModel
@{
Layout = null;
}
<h1>Your Success View</h1>
<div>
@Html.Raw(Model.response)
</div>
In the above code, the Html.Raw method is used to render the contents of Model.response without encoding the HTML tags. This should display the parsed HTML content in the success view instead of the raw HTML code.
Note: Be careful when using Html.Raw as it can potentially lead to cross-site scripting (XSS) vulnerabilities if you are not careful about the input you are rendering. Make sure to validate and sanitize the input before rendering it in your view.
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Most Viewed Articles (in csharp )
Using Microsoft Authenticator for 2FA in C Sharp. (C#)
Is it safe to delete bin folder in a razorsharp c# project folder?
C Sharp MVC Razor code for a login screen and its controller
Display the HTML content in your C# view
Latest Articles (in csharp)
© 2023 Java-samples.com
Tutorial Archive: Data Science React Native Android AJAX ASP.net C C++ C# Cocoa Cloud Computing EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Trends WebServices XML Office 365 Hibernate
Latest Tutorials on: Data Science React Native Android AJAX ASP.net C Cocoa C++ C# EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Cloud Computing WebServices XML Office 365 Hibernate