AntiXssEncoder.MarkAsSafe(LowerCodeCharts, LowerMidCodeCharts, MidCodeCharts, UpperMidCodeCharts, UpperCodeCharts) AntiXssEncoder.MarkAsSafe(LowerCodeCharts, LowerMidCodeCharts, MidCodeCharts, UpperMidCodeCharts, UpperCodeCharts) AntiXssEncoder.MarkAsSafe(LowerCodeCharts, LowerMidCodeCharts, MidCodeCharts, UpperMidCodeCharts, UpperCodeCharts) Method

Definition

Marks characters from the specified Unicode code charts as safe.

public:
 static void MarkAsSafe(System::Web::Security::AntiXss::LowerCodeCharts lowerCodeCharts, System::Web::Security::AntiXss::LowerMidCodeCharts lowerMidCodeCharts, System::Web::Security::AntiXss::MidCodeCharts midCodeCharts, System::Web::Security::AntiXss::UpperMidCodeCharts upperMidCodeCharts, System::Web::Security::AntiXss::UpperCodeCharts upperCodeCharts);
public static void MarkAsSafe (System.Web.Security.AntiXss.LowerCodeCharts lowerCodeCharts, System.Web.Security.AntiXss.LowerMidCodeCharts lowerMidCodeCharts, System.Web.Security.AntiXss.MidCodeCharts midCodeCharts, System.Web.Security.AntiXss.UpperMidCodeCharts upperMidCodeCharts, System.Web.Security.AntiXss.UpperCodeCharts upperCodeCharts);
static member MarkAsSafe : System.Web.Security.AntiXss.LowerCodeCharts * System.Web.Security.AntiXss.LowerMidCodeCharts * System.Web.Security.AntiXss.MidCodeCharts * System.Web.Security.AntiXss.UpperMidCodeCharts * System.Web.Security.AntiXss.UpperCodeCharts -> unit

Parameters

lowerCodeCharts
LowerCodeCharts LowerCodeCharts LowerCodeCharts

The combination of lower code charts to mark as safe.

lowerMidCodeCharts
LowerMidCodeCharts LowerMidCodeCharts LowerMidCodeCharts

The combination of lower-middle code charts to mark as safe.

midCodeCharts
MidCodeCharts MidCodeCharts MidCodeCharts

The combination of middle code charts to mark as safe.

upperMidCodeCharts
UpperMidCodeCharts UpperMidCodeCharts UpperMidCodeCharts

The combination of upper-middle code charts to mark as safe.

upperCodeCharts
UpperCodeCharts UpperCodeCharts UpperCodeCharts

The combination of upper code charts to mark as safe.

Exceptions

Remarks

The safe list affects all HTML XML, CSS, and URL encoding methods.

With some exceptions, Unicode code charts do not directly correspond to written languages. To add support for a specific language or set of languages often requires marking multiple code charts as safe.

To add support for the Japanese language while continuing to allow English, use the following syntax:


MarkAsSafe(  
            LowerCodeCharts.Default,  
            LowerMidCodeCharts.HangulJamo,  
            MidCodeCharts.None,  
            UpperMidCodeCharts.CjkRadicalsSupplement |   
            UpperMidCodeCharts.CjkSymbolsAndPunctuation |   
            UpperMidCodeCharts.Hiragana |   
            UpperMidCodeCharts.Katakana |   
            UpperMidCodeCharts.KatakanaPhoneticExtensions |   
            UpperMidCodeCharts.LatinExtendedD |  
            UpperMidCodeCharts.CjkUnifiedIdeographs,  
            UpperCodeCharts.None);  

Note

The MarkAsSafe method must be called in the Application_Start method in the Global.asax file.

Applies to