Provides methods for encoding strings.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
'Declaration <AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _ <AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _ Public Class SPEncode 'Usage Dim instance As SPEncode
Use the methods in the class as a security precaution to help prevent malicious script blocks from being able to execute in applications that execute across sites.
You do not need to instantiate the class to use them because all its methods are static.
In code that calls members within the Microsoft.SharePoint assembly, the encoding methods of the SPEncode class are more effective than methods of the [System.Web.HttpUtility] and [System.Web.HttpServerUtility] classes. The methods in the SPEncode class for encoding URLs and HTML can be used to encode a larger set of characters than the methods in the [System.Web.HttpUtility] and [System.Web.HttpServerUtility] classes.