Freigeben über


TagBuilder.MergeAttribute Method (String, String, Boolean)

Adds an attribute to the tag by using the specified key/value pair.

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

Syntax

'Declaration
Public Sub MergeAttribute ( _
    key As String, _
    value As String, _
    replaceExisting As Boolean _
)
public void MergeAttribute(
    string key,
    string value,
    bool replaceExisting
)
public:
void MergeAttribute(
    String^ key, 
    String^ value, 
    bool replaceExisting
)

Parameters

  • replaceExisting
    Type: System.Boolean
    true to replace the existing attribute.

Exceptions

Exception Condition
ArgumentException

The key parameter is null reference (Nothing in Visual Basic) or empty.

See Also

Reference

TagBuilder Class

MergeAttribute Overload

System.Web.Mvc Namespace