What I want is to convert the output IHtmlString to String.
I have this code:
string text = @Html.Raw(Model.lastNoticias.Descricao);
This code return the error:
Cannot implicitly convert type System.Web.IHtmlString to string.
The full code:
@{
string text = @Html.Raw(Model.lastNoticias.Descricao);
}
@if (text.Length > 100)
{
@(text.Substring(0, 100) + "... ");
}
How can I do it?
string text = Model.lastNoticias.Descricao;?