NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

HtmlButton Class

The HtmlButton class defines the methods, properties and events for the HtmlButton control. This class allows programmatic access to the HTML <button> element on the server.

Object
   Control
      HtmlControl
         HtmlContainerControl
            HtmlButton

[Visual Basic]
Public Class HtmlButton
   Inherits HtmlContainerControl
   Implements IPostBackEventHandler
[C#]
public class HtmlButton : HtmlContainerControl,
   IPostBackEventHandler
[C++]
public __gc class HtmlButton : public HtmlContainerControl,
   IPostBackEventHandler
[JScript]
public class HtmlButton extends HtmlContainerControl,
   IPostBackEventHandler

Remarks

The <button> element allows Web developers to create UI form buttons that can be composed of embedded HTML elements, including other server controls.

Note   Since the <button> element is defined in the HTML 4.0 specification and is only supported in Microsoft Internet Explorer version 4.0 and higher. To create UI form buttons accessible to all browsers, consider using the HtmlImageButton class.

Requirements

Namespace: System.Web.UI.HtmlControls

Assembly: System.Web.dll

Example [Visual Basic]

[Visual Basic]

<html>
   <script runat=server>
      Sub FancyBtn_Click(Source As Object, E as EventArgs)
         Message.InnerHtml = "Your name is: " & Name.Value
      End Sub
   </script>
 
   <body>
         <form method=post runat=server>
 
           <h3> Enter Name: <input id="Name" type=text size=40 runat=server>
           </h3>
 
<button OnServerClick=" FancyBtn_Click" runat=server>
  <b><I> I'm a fancy HTML 4.0 button </I> </b> 
</button>
 
          
          <h1>
<span id="Message" runat=server></span>
          </h1>
 
         </form>
      </body>
</html>

See Also

HtmlButton Members | System.Web.UI.HtmlControls Namespace