HtmlEncode from Class Library

后端 未结 8 1154
情书的邮戳
情书的邮戳 2020-11-29 23:15

I have a class library (in C#). I need to encode my data using the HtmlEncode method. This is easy to do from a web application. My question is, how do I use this method fro

相关标签:
8条回答
  • 2020-11-30 00:14

    In case you're using SharePoint 2010, using the following line of code will avoid having to reference the whole System.Web library:

    Microsoft.SharePoint.Utilities.SPHttpUtility.HtmlEncode(stringToEncode);
    
    0 讨论(0)
  • 2020-11-30 00:14

    In case you are working with silverlight, use this:

    System.Windows.Browser.HttpUtility.HtmlEncode(...);
    
    0 讨论(0)
提交回复
热议问题