ButtonsAndLinkExtensions.SubmitButton Method (HtmlHelper, String, String, Object)

Creates a submit button for your form.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function SubmitButton ( _
    helper As HtmlHelper, _
    name As String, _
    buttonText As String, _
    htmlAttributes As Object _
) As MvcHtmlString
'Usage
Dim helper As HtmlHelper 
Dim name As String 
Dim buttonText As String 
Dim htmlAttributes As Object 
Dim returnValue As MvcHtmlString 

returnValue = helper.SubmitButton(name, _
    buttonText, htmlAttributes)
public static MvcHtmlString SubmitButton(
    this HtmlHelper helper,
    string name,
    string buttonText,
    Object htmlAttributes
)
[ExtensionAttribute]
public:
static MvcHtmlString^ SubmitButton(
    HtmlHelper^ helper, 
    String^ name, 
    String^ buttonText, 
    Object^ htmlAttributes
)
static member SubmitButton : 
        helper:HtmlHelper * 
        name:string * 
        buttonText:string * 
        htmlAttributes:Object -> MvcHtmlString
public static function SubmitButton(
    helper : HtmlHelper, 
    name : String, 
    buttonText : String, 
    htmlAttributes : Object
) : MvcHtmlString

Parameters

  • 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 submit 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

SubmitButton Overload

Microsoft.Web.Mvc Namespace