I need to parse some HTML from the server side. So I've used


MyFunction returns me the below value

<!--some HTML -->
    Please click the link here to see the <a href='@(MySiteSettings.DocumentURL + "Documents/MyPDFFile.pdf")' target="_blank">Changes to Your Screens</a>.
<!--some other HTML -->

I am expecting the anchor tag to be rendered like,

<a href='http://mydocumenturl/Documents/MyPDFFile.pdf' target="_blank">Changes to Your Screens</a>

but it is rendered instead as below.

<a href='http://mycurrenturl/@(MySiteSettings.DocumentURL + "Documents/MyPDFFile.pdf")' target="_blank">Changes to Your Screens</a>

I have already tried






For escaping '@' in Html.Raw, but no luck.

Related posts

Recent Viewed