why htmlcode is not converting in razor

Viewed 25

Im developing in C# MVC, the problem appears when data is brought into the view on the first load and try to fill from the Model, I use webutility library and call the function htmldecode because I have special characters that I need to convert. but when I do it, it throws an error. here i leave a snipt of my code.

@{ foreach (var item in Model)
         {

                @:color.push(dynamicColors());
                @:bars.data.datasets[0].data.push(parseInt(@item.intPorcentRepara));

                @:bars.data.labels.push(@WebUtility.HtmlDecode(@item.Descripcion));

                @:bars.data.labels.push(decodeURIComponent(descripcion));
         }
        }

and this is the error that shows up

bars.data.labels.push(SERVICIO DE REPARACIÓN DE EQUIPOS DE RF);

I also have tried to convert it with javascript but without success, I hope you can help me.

Thanks in advance

0 Answers
Related