I am writing an application in which we are consuming a service which returns the results.
The result is having some HTML elements which are to be printed as it is.
Sample Result : {values ="Lorem impsum loren ipsum <span class=\"boldc\">bold value </span> lorenipsum .....}
Now this has to be displayed in an ASP.NET page. If I HTML encode, the span gets encoded I cannot make the items bold as desired.
@Html.Raw(Message)
- this works but opens all the vulnerabilities and is dangerous.
What is the best way to handle this scenario ? Is there any way in which I can print these HTMl characters ; yet have the safety ?