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

A Simple button you can use with JavaScript.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function Button ( _
    helper As HtmlHelper, _
    name As String, _
    buttonText As String, _
    buttonType As HtmlButtonType, _
    onClickMethod As String _
) As MvcHtmlString
'Usage
Dim helper As HtmlHelper 
Dim name As String 
Dim buttonText As String 
Dim buttonType As HtmlButtonType 
Dim onClickMethod As String 
Dim returnValue As MvcHtmlString 

returnValue = helper.Button(name, _
    buttonText, buttonType, onClickMethod)
public static MvcHtmlString Button(
    this HtmlHelper helper,
    string name,
    string buttonText,
    HtmlButtonType buttonType,
    string onClickMethod
)
[ExtensionAttribute]
public:
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
public static function Button(
    helper : HtmlHelper, 
    name : String, 
    buttonText : String, 
    buttonType : HtmlButtonType, 
    onClickMethod : String
) : 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.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelper. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.118) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.118).

See Also

Reference

ButtonsAndLinkExtensions Class

Button Overload

Microsoft.Web.Mvc Namespace