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 | |
---|---|---|
![]() ![]() |
Button(HtmlHelper, String, String, HtmlButtonType) | A Simple button you can use with JavaScript. |
![]() ![]() |
Button(HtmlHelper, String, String, HtmlButtonType, String) | A Simple button you can use with JavaScript. |
![]() ![]() |
Button(HtmlHelper, String, String, HtmlButtonType, String, IDictionary<String, Object>) | A Simple button you can use with JavaScript. |
![]() ![]() |
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
helper
Type: System.Web.Mvc.HtmlHelperThe helper which we extend.
name
Type: System.StringName of the button.
buttonText
Type: System.StringThe text for the button face.
buttonType
Type: Microsoft.Web.Mvc.HtmlButtonTypeThe button type (Button, Submit, or Reset).
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
helper
Type: System.Web.Mvc.HtmlHelperThe helper which we extend.
name
Type: System.StringName of the button.
buttonText
Type: System.StringThe text for the button face.
buttonType
Type: Microsoft.Web.Mvc.HtmlButtonTypeThe button type (Button, Submit, or Reset).
onClickMethod
Type: System.StringThe 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
helper
Type: System.Web.Mvc.HtmlHelperThe helper which we extend.
name
Type: System.StringName of the button.
buttonText
Type: System.StringThe text for the button face.
buttonType
Type: Microsoft.Web.Mvc.HtmlButtonTypeThe button type (Button, Submit, or Reset).
onClickMethod
Type: System.StringThe method or script routine to call when the button is clicked.
htmlAttributes
Type: System.Collections.Generic.IDictionary<String, 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
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
helper
Type: System.Web.Mvc.HtmlHelperThe helper which we extend.
name
Type: System.StringName of the button.
buttonText
Type: System.StringThe text for the button face.
buttonType
Type: Microsoft.Web.Mvc.HtmlButtonTypeThe button type (Button, Submit, or Reset).
onClickMethod
Type: System.StringThe method or script routine to call when the button is clicked.
htmlAttributes
Type: System.ObjectAny 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