I'm new to this with ASP .Net MVC, I have the following Helper that should show me an icon indicating the sort order (Ascending or descending):
public static IHtmlString IndicaOrden(this HtmlHelper htmlHelper, string sortOrden, string campo)
{
if (string.IsNullOrEmpty(sortOrden) || (sortOrden.Trim() != campo && sortOrden.Replace("_desc", "").Trim() != campo))
return null;
string icono = "glyphicon glyphicon-chevron-up";
if (sortOrden.ToLower().Contains("desc"))
{
icono = "glyphicon glyphicon-chevron-down";
}
var tag = new TagBuilder("span");
tag.Attributes["class"] = icono;
return MvcHtmlString.Create(tag.ToString(TagRenderMode.Normal));
}
Instead of returning an HTML tag " <span class="glypicon glyphicon-chevron-up"></span>
" returns me ";"
Here I make the call in the view:
<th>
@Html.ActionLink("Ficha","Index",Request.QueryString.ParametrosURL("sortOrden", (string)ViewBag.FichaSort ) )
@Html.IndicaOrden(sortActual,"VEH_FICHA");
</th>
I really can not find the problem.
Greetings.