TagBuilder.CreateSanitizedId(String, String) Method

Definition

Returns a valid HTML 4.01 "id" attribute value for an element with the given name.

public:
 static System::String ^ CreateSanitizedId(System::String ^ name, System::String ^ invalidCharReplacement);
public static string CreateSanitizedId (string name, string invalidCharReplacement);
public static string CreateSanitizedId (string? name, string invalidCharReplacement);
static member CreateSanitizedId : string * string -> string
Public Shared Function CreateSanitizedId (name As String, invalidCharReplacement As String) As String

Parameters

name
String

The fully-qualified expression name, ignoring the current model. Also the original HTML element name.

invalidCharReplacement
String

The String (normally a single Char) to substitute for invalid characters in name.

Returns

Valid HTML 4.01 "id" attribute value for an element with the given name.

Remarks

Valid "id" attributes are defined in https://www.w3.org/TR/html401/types.html#type-id.

Applies to