ASP.NET Tutorial – Chapter 3: Using the button control
It is an important control you should dominate well when you are
programming web applications in ASP.NET. This control let you execute
all kind of commands and scripts that you write in ASP. In this
chapter we are going to see some basic examples that demonstrate the
different uses of the button control in ASP.NET
<strong> <html> <body> <form runat="server"> <asp:Button id="b1" Text="Submit" runat="server" /> </form> </body> </html></strong>
In the next example you will have a script where once your press the
button will be displayed a messaged saying: “Thanks for click this
button. Please, do it again”. You can openly use this ASP.NET script
and modify it in a way that fit to your needs.
<html> <head> <script language="VB" runat="server"> Sub Button1_Click(sender As Object, e As EventArgs) Label1.Text="Thanks for click this button. Please, do it again" End Sub </script></span> </head> <body> <h3><font face="Verdana">PostBack Using Button</font></h3> <span style="color: #008000;"><form runat=server> <asp:Button id=Button1 Text="Click Me" onclick="Button1_Click" runat="server" /> <asp:Label id=Label1 runat=server /> </form></span> </body> </html></strong>
