| || |
Join Date: Oct 2008
ASP.NET Working with Buttons
The following example demonstrate the technique to create two buttons on a page.Buttons are used to trigger actions. Without buttons, we cannot do any sort of work on the form. Button is a Webform control in ASP.Net and the name of the control is Button. HTML elements in ASP .NET files are, by default, treated as text. To make these elements programmable, add a runat="server" attribute to the HTML element. This attribute indicates that the element should be treated as a server control.
Here we are creating a button and its id is defined as b1. text property is used to display the caption of the button on the page. Tooltip property is used to display the tooltip text when you move your mouse over the button.
<form method = "post" runat = "server">
<asp:Button id = "b1" runat = "server" text = "OK" ToolTip = "Click here to Submit">
<asp:Button id = "b2" runat = "server" text = "Cancel" ToolTip = "Click here to Cancel">