@ Html.Raw insiste en codificar citas

MVC4 vista de la maquinilla de afeitar Dado que una cadenabackgroundImage se establece de esta manera:

backgroundImage = string.Format("background: url('{0}') top left no-repeat;", project.MainImage);

Porque hace esto

<div class="spotlight slide teaser-text" id="@slideId" style="@Html.Raw(backgroundImage)">

Produce

<div class="spotlight slide teaser-text" id="spotlight-0" style="background: url(&#39;/media/215/spotlight01.jpg&#39;) top left no-repeat;">

Html.Raw, new MvcHtmlString yMvcHtmlString.Create todos se comportan de manera similar.

me gustaríaesperar para producir

<div class="spotlight slide teaser-text" id="spotlight-0" style="background: url('/media/215/spotlight01.jpg') top left no-repeat;">

(note las citas).

Respuestas a la pregunta(1)

Su respuesta a la pregunta