HtmlInputButton Constructor
Collapse the table of content
Expand the table of content

HtmlInputButton Constructor

.NET Framework 1.1

Initializes a new instance of an HtmlInputButton class.

Overload List

Initializes a new instance of an HtmlInputButton class using default values.

[Visual Basic] Public Sub New()
[C#] public HtmlInputButton();
[C++] public: HtmlInputButton();
[JScript] public function HtmlInputButton();

Initializes a new instance of an HtmlInputButton class using the specified button type.

[Visual Basic] Public Sub New(String)
[C#] public HtmlInputButton(string);
[C++] public: HtmlInputButton(String*);
[JScript] public function HtmlInputButton(String);

Example

[Visual Basic, C#] The following example demonstrates how to create a new instance of an HtmlInputButton control using the overloaded constructor.

[Visual Basic, C#] Note   This example shows how to use one of the overloaded versions of the HtmlInputButton constructor. For other examples that might be available, see the individual overload topics.
[Visual Basic] 

<%@ Page Language="VB" AutoEventWireup="True" %>

<html>

<head>

   <script runat="server">

      Sub Page_Load(sender As Object, e As EventArgs)

         ' Create a new HtmlInputButton control. 
         Dim button As HtmlInputButton = new HtmlInputButton("submit")
         button.Value="Submit"

         ' Add the control to the Controls collection of the
         ' PlaceHolder control. 
         Place.Controls.Clear()
         Place.Controls.Add(button)

      End Sub

   </script>

</head>

<body>

   <form runat="server">

      <h3> HtmlInputButton Constructor Example </h3>

      <asp:Placeholder id="Place" 
           runat="server"/>

   </form>

</body>

</html>


[C#] 

<%@ Page Language="C#" AutoEventWireup="True" %>

<html>

<head>

   <script runat="server">

      void Page_Load(Object sender, EventArgs e)
      {

         // Create a new HtmlInputButton control.
         HtmlInputButton button = new HtmlInputButton("submit");
         button.Value="Submit";

         // Add the control to the Controls collection of the
         // PlaceHolder control.
         Place.Controls.Clear();
         Place.Controls.Add(button);

      }

   </script>

</head>

<body>

   <form runat="server">

      <h3> HtmlInputButton Constructor Example </h3>

      <asp:Placeholder id="Place" 
           runat="server"/>

   </form>

</body>

</html>

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

HtmlInputButton Class | HtmlInputButton Members | System.Web.UI.HtmlControls Namespace

Show:
© 2016 Microsoft