Share via


ButtonsAndLinkExtensions.Button Method

 

A Simple button you can use with JavaScript.

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

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static Button(HtmlHelper, String, String, HtmlButtonType)

A Simple button you can use with JavaScript.

System_CAPS_pubmethodSystem_CAPS_static Button(HtmlHelper, String, String, HtmlButtonType, String)

A Simple button you can use with JavaScript.

System_CAPS_pubmethodSystem_CAPS_static Button(HtmlHelper, String, String, HtmlButtonType, String, IDictionary<String, Object>)

A Simple button you can use with JavaScript.

System_CAPS_pubmethodSystem_CAPS_static Button(HtmlHelper, String, String, HtmlButtonType, String, Object)

A Simple button you can use with JavaScript.

See Also

ButtonsAndLinkExtensions Class
Microsoft.Web.Mvc Namespace

Return to top

ButtonsAndLinkExtensions.Button Method (HtmlHelper, String, String, HtmlButtonType)

A Simple button you can use with JavaScript.

Syntax

public static MvcHtmlString Button(
    this HtmlHelper helper,
    string name,
    string buttonText,
    HtmlButtonType buttonType
)
public:
[ExtensionAttribute]
static MvcHtmlString^ Button(
    HtmlHelper^ helper,
    String^ name,
    String^ buttonText,
    HtmlButtonType buttonType
)
static member Button : 
        helper:HtmlHelper *
        name:string *
        buttonText:string *
        buttonType:HtmlButtonType -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function Button (
    helper As HtmlHelper,
    name As String,
    buttonText As String,
    buttonType As HtmlButtonType
) As MvcHtmlString

Parameters

Return Value

Type: System.Web.Mvc.MvcHtmlString

A MvcHtmlString that represents the button.

Return to top

ButtonsAndLinkExtensions.Button Method (HtmlHelper, String, String, HtmlButtonType, String)

A Simple button you can use with JavaScript.

Syntax

public static MvcHtmlString Button(
    this HtmlHelper helper,
    string name,
    string buttonText,
    HtmlButtonType buttonType,
    string onClickMethod
)
public:
[ExtensionAttribute]
static MvcHtmlString^ Button(
    HtmlHelper^ helper,
    String^ name,
    String^ buttonText,
    HtmlButtonType buttonType,
    String^ onClickMethod
)
static member Button : 
        helper:HtmlHelper *
        name:string *
        buttonText:string *
        buttonType:HtmlButtonType *
        onClickMethod:string -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function Button (
    helper As HtmlHelper,
    name As String,
    buttonText As String,
    buttonType As HtmlButtonType,
    onClickMethod As String
) As MvcHtmlString

Parameters

  • onClickMethod
    Type: System.String

    The method or script routine to call when the button is clicked.

Return Value

Type: System.Web.Mvc.MvcHtmlString

A MvcHtmlString that represents the button.

Return to top

ButtonsAndLinkExtensions.Button Method (HtmlHelper, String, String, HtmlButtonType, String, IDictionary<String, Object>)

A Simple button you can use with JavaScript.

Syntax

public static MvcHtmlString Button(
    this HtmlHelper helper,
    string name,
    string buttonText,
    HtmlButtonType buttonType,
    string onClickMethod,
    IDictionary<string, object> htmlAttributes
)
public:
[ExtensionAttribute]
static MvcHtmlString^ Button(
    HtmlHelper^ helper,
    String^ name,
    String^ buttonText,
    HtmlButtonType buttonType,
    String^ onClickMethod,
    IDictionary<String^, Object^>^ htmlAttributes
)
static member Button : 
        helper:HtmlHelper *
        name:string *
        buttonText:string *
        buttonType:HtmlButtonType *
        onClickMethod:string *
        htmlAttributes:IDictionary<string, Object> -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function Button (
    helper As HtmlHelper,
    name As String,
    buttonText As String,
    buttonType As HtmlButtonType,
    onClickMethod As String,
    htmlAttributes As IDictionary(Of String, Object)
) As MvcHtmlString

Parameters

  • onClickMethod
    Type: System.String

    The method or script routine to call when the button is clicked.

Return Value

Type: System.Web.Mvc.MvcHtmlString

A MvcHtmlString that represents the button.

Return to top

ButtonsAndLinkExtensions.Button Method (HtmlHelper, String, String, HtmlButtonType, String, Object)

A Simple button you can use with JavaScript.

Syntax

public static MvcHtmlString Button(
    this HtmlHelper helper,
    string name,
    string buttonText,
    HtmlButtonType buttonType,
    string onClickMethod,
    object htmlAttributes
)
public:
[ExtensionAttribute]
static MvcHtmlString^ Button(
    HtmlHelper^ helper,
    String^ name,
    String^ buttonText,
    HtmlButtonType buttonType,
    String^ onClickMethod,
    Object^ htmlAttributes
)
static member Button : 
        helper:HtmlHelper *
        name:string *
        buttonText:string *
        buttonType:HtmlButtonType *
        onClickMethod:string *
        htmlAttributes:Object -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function Button (
    helper As HtmlHelper,
    name As String,
    buttonText As String,
    buttonType As HtmlButtonType,
    onClickMethod As String,
    htmlAttributes As Object
) As MvcHtmlString

Parameters

  • onClickMethod
    Type: System.String

    The method or script routine to call when the button is clicked.

  • htmlAttributes
    Type: System.Object

    Any attributes you want set on the tag. Use anonymous-type declaration for this: new{class=cssclass}.

Return Value

Type: System.Web.Mvc.MvcHtmlString

A MvcHtmlString that represents the button.

Return to top