Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display razor from database

I am trying to display content such as

<p>Text and link - @Html.ActionLink("Link", "Action")</p>

from a database, but if I use @Html.Raw then it doesn't render the link.

Is there anyway to do this?

like image 552
Pete Avatar asked Nov 03 '22 12:11

Pete


1 Answers

You will need to use a Razor parser in order to achieve that. Checkout RazorEngine which could be used render the Razor markup to HTML.

like image 67
Darin Dimitrov Avatar answered Nov 15 '22 07:11

Darin Dimitrov