HtmlInputReset Class

HtmlInputReset Class

Note: This class is new in the .NET Framework version 2.0.

Allows programmatic access to the HTML <input type=reset> element on the server.

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

Public Class HtmlInputReset
	Inherits HtmlInputButton
Dim instance As HtmlInputReset

public class HtmlInputReset extends HtmlInputButton
public class HtmlInputReset extends HtmlInputButton

The HtmlInputReset class is derived from the HtmlInputButton class and is used to create a button control on a Web page that resets form controls to their initial values. The HtmlInputReset control is often used with the HtmlInputSubmit control, which is used to create a button control that submits the form.

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

The following code example demonstrates how to use the HtmlInputReset control to reset the values of a form on a Web page.

<%@ Page Language="VB" %>

<script runat="server">

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

    ' Define an HtmlInputReset button using the default constructor.
    Dim reset1 As New HtmlInputReset()
    reset1.ID = "ResetButton1"
    reset1.Value = "Reset 1"
    ' Define an HtmlInputReset button as type "reset".
    Dim reset2 As New HtmlInputReset("reset")
    reset2.ID = "ResetButton2"
    reset2.Value = "Reset 2"

    ' Define an HtmlInputReset button as custom type "custom".
    ' This is not a valid HTML input type so a standared input
    ' field will be displayed.
    Dim reset3 As New HtmlInputReset("custom")
    reset3.ID = "ResetButton3"
    reset3.Value = "Reset 3"
    ' Clear the PlaceHolder control and add the Reset buttons to it.
    PlaceHolder.Controls.Add(New LiteralControl("<br>"))
    PlaceHolder.Controls.Add(New LiteralControl("<br>"))
  End Sub



  <title>HtmlInputReset Example</title>


    <form runat="server">

      <h3> HtmlInputReset Example </h3>

      <asp:PlaceHolder id="PlaceHolder"
      <br />

      Change the text in the input field and then click 
      "Reset 1" or "Reset 2" to change it back to its initial



  • 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

Community Additions

© 2016 Microsoft