Hyperlink: command name and url (VB.net) : Hyperlink « Asp Control « ASP.Net






Hyperlink: command name and url (VB.net)

<%@ Page Language="vb" %>
<html>
<head>
   <title>Action Control Example</title>
   <script runat="server">
      Sub Page_Load()
         MyButton.CommandName = "Sort"
         MyImageButton.CommandArgument = "Ascending"
         MyLinkButton.CommandName = "Filter"
         MyHyperLink.NavigateUrl = " http://www.java2s.com/"
      End Sub
   </script>
</head>
<body>
   <h1>Action Control Example</h1>
   <form runat="server">
      <asp:table id="MyTable" border="1" cellpadding="5" cellspacing="0" runat="server">
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               Button Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:button id="MyButton" text="Click Me!!" runat="server"/>
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               ImageButton Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:imagebutton id="MyImageButton" 
                  imageurl="http://www.java2s.com/style/logo.png" runat="Server"/>
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               LinkButton Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:linkbutton id="MyLinkButton" text="Click Me" runat="server"/>
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               HyperLink Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:hyperlink id="MyHyperLink" 
                  text="Click Me" 
                  navigateurl="ActionControls.aspx" 
                  target="_blank" 
                  runat="server"/>
            </asp:tablecell>
         </asp:tablerow>
      </asp:table>
   </form>
</body>
</html>

           
       








Related examples in the same category

1.Displaying a Graphic on a HyperLink Control (VB.net)
2.asp:HyperLink: border style and width (VB.net)
3.asp:HyperLink with NavigateURL (VB.net)
4.asp Hyperlink button (C#)
5.asp hyperlink: font, width and text (C#)