samedi 27 juin 2015

How to Decode Html in controller

Hi i have htmlencoded content, now i want convert it into string..

\u003cmeta charset=\"\u0026amp;quot;utf-8\u0026quot;\u0026amp;quot;\" content=\"\u0026amp;quot;\u0026quot;text/html;\u0026amp;quot;\" http-equiv=\"\u0026amp;quot;\u0026quot;Content-Type\u0026quot;\u0026amp;quot;\" /\u003e\u003cmeta

I want to convert this content into readable string...

i have try to use this

string javascriptencode = HttpUtility.JavaScriptStringEncode(document.Document);
            string html = HttpUtility.HtmlAttributeEncode(javascriptencode);

           string s = HttpUtility.HtmlEncode(html);

now if i want to show this on razor page then there is @html.Raw(""); can use but i want to do this on controller side, so how can i use @html.Raw("") alternative in controller..

please give some idea...

Thank you in advance Regards,

Aucun commentaire:

Enregistrer un commentaire