Good day, I'm try to use action links with Url.Action
inside @Html.Raw
in my ASP.NET MVC3 project. Everything works fine without @Html.Raw
, but with it images can't display on the page, I'm try to use Html.Encode
inside Raw, but then it's show me the naked HTML on the page.
@Html.Raw(<a href="@Url.Action("ActionName", "Controller", new {id = 1})" target="_blank">
<img src="@Url.Content("~/Content/Images/simpleImage.png")"/>
</a>)
Any ideas why it's not render right code?Also when I hover over the place with image it pop up for me next code: sitename.com/Controller/@Url.Action(
I'm try to shielding the " it's not help
Edit
This action link is a part of query from database, which I display like next:
@Html.Raw(model.FieldWithHtmlCharactersInDatabase)