This documentation is archived and is not being maintained.

HtmlInputButton Class

Allows programmatic access to the HTML <input type= button>, <input type= submit>, and <input type= reset> elements on the server.

Namespace: System.Web.UI.HtmlControls
Assembly: System.Web (in system.web.dll)

Public Class HtmlInputButton
	Inherits HtmlInputControl
	Implements IPostBackEventHandler
Dim instance As HtmlInputButton

public class HtmlInputButton extends HtmlInputControl implements IPostBackEventHandler
public class HtmlInputButton extends HtmlInputControl implements IPostBackEventHandler

Use the HtmlInputButton class to create button controls on a Web page. An <input type=button> HTML element is a push button with no default behavior when clicked. An <input type=submit> HTML element is a button that submits a form when clicked. An <input type=reset> HTML button resets all controls to their initial values when clicked.

In ASP.NET 2.0, use the HtmlInputReset class and the HtmlInputSubmit class to create Reset and Submit buttons, respectively.

For a list of initial property values for an instance of HtmlInputButton, see the HtmlInputButton constructor.

The following code example demonstrates how to use the HtmlInputButton control to create a command button, a Submit button, and a Reset button.

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<script runat="server">
  Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)

    Message.InnerText = "You entered: " + Server.HtmlEncode(Input1.Value)

  End Sub

<html xmlns="" >
<head id="Head1" runat="server">
    <title>HtmlInputButton Example</title>
    <form id="myform"
      <input id="Input1"
      <input id="SubmitButton"
             runat="server" />
      <input id="ResetButton"
             runat="server" />
      <input id="Button"
             onclick="alert('Hello from the client side.');"
             runat="server" />
      <br />
      <span  id="Message" 

  • AspNetHostingPermission  for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
  • AspNetHostingPermission  for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0