ASP Net Controls ASP.Net Tutorial

<%@ Page Language="VB" %>


    Protected Sub Button_Command(ByVal sender As Object, _
      ByVal e As System.Web.UI.WebControls.CommandEventArgs)
        Select Case e.CommandName
            Case "DoSomething1"
                Response.Write("Button 1 was selected")
            Case "DoSomething2"
                Response.Write("Button 2 was selected")
        End Select
    End Sub



    Buttons


    
    

                            Runat="server" 
                    Text="Button 1" 
                    OnCommand="Button_Command" 
                    CommandName="DoSomething1" />
                            Runat="server" 
                    Text="Button 2" 
                    OnCommand="Button_Command" 
                    CommandName="DoSomething2"/>