Sdílet prostřednictvím


HtmlHelper.GenerateIdFromName Method (String, String)

Creates an HTML element ID using the specified element name and a string that replaces dots in the name.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

'Declaration
Public Shared Function GenerateIdFromName ( _
    name As String, _
    idAttributeDotReplacement As String _
) As String
public static string GenerateIdFromName(
    string name,
    string idAttributeDotReplacement
)
public:
static String^ GenerateIdFromName(
    String^ name, 
    String^ idAttributeDotReplacement
)

Parameters

  • idAttributeDotReplacement
    Type: System.String
    The string that replaces dots (.) in the name parameter.

Return Value

Type: System.String
The ID of the HTML element.

Exceptions

Exception Condition
ArgumentNullException

The name parameter or the idAttributeDotReplacement parameter is null reference (Nothing in Visual Basic).

See Also

Reference

HtmlHelper Class

GenerateIdFromName Overload

System.Web.Mvc Namespace