ASP.NET(vb.net) & Button - asp:Button - asp:Buttor : Displays a push button control on the Web Forms page.
ShotDev Focus:
- ASP.NET(vb.net) & Button - asp:Button
Tag Control :
<asp:Button id="MyButton" Text="label" CommandName="command" CommandArgument="commandargument" CausesValidation="true | false" OnClick="OnClickMethod" runat="server"/>
Example
Button.aspx
<%@ Page Language="VB" %> <script runat="server"> Sub Button1_OnClick(sender as Object, e As EventArgs) Me.lblText.Text = "Welcome To [" & Me.txtName.Text & "] ShotDev.Com" End Sub '*** Or ***' 'Sub Button1OnClick(sender as Object, e As EventArgs) Handles Button1.Click 'Me.lblText.Text = "Welcome To [" & Me.txtName.Text & "] ShotDev.Com" 'End Sub </script> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <form runat="server"> <asp:Label id="lblTopic" runat="server" text="Enter Your Name : "></asp:Label> <asp:TextBox id="txtName" runat="server"></asp:TextBox> <asp:Button id="Button1" onclick="Button1_OnClick" runat="server" Text="Button"></asp:Button> <br /> <br /> <asp:Label id="lblText" runat="server"></asp:Label> </form> </body> </html>
Screenshot