Tuesday, February 15, 2011

how to submit a form in asp.net

A form is most often submitted by clicking on a button. The Button server control in ASP.NET has the following format:
<asp:Button id="id" text="label" OnClick="sub" runat="server" />
The id attribute defines a unique name for the button and the text attribute assigns a label to the button. The onClick event handler specifies a named subroutine to execute.
In the following example we declare a Button control in an .aspx file. A button click runs a subroutine which changes the text on the button:
source w3schools.com