Change img border stype in Input Button action (VB.net) : Event « Language Basics « ASP.NET Tutorial






<%@ Page Language="VB" %>

<script runat="server">
   Sub Click(Sender as Object, e as EventArgs)
      select case Sender.Value
         case "Left"
            word_image.align = "left"
         case "Right"
            word_image.align = "right"
         case "Center"
            word_image.align = "center"
      end select
    
      Left.Style("Border-Style") = "notset"
      Right.Style("Border-Style") = "notset"
      Center.Style("Border-Style") = "notset"
    
      Sender.Style("Border-Style") = "inset"
    end Sub
</script>

<html><body>
    <form runat="server">
       <input type="Button" id="Left" runat="server" 
          Value="Left" OnServerClick="Click" />
       <input type="Button" id="Center" runat="server" 
          Value="Center" OnServerClick="Click" />
       <input type="Button" id="Right" runat="server" 
          Value="Right" OnServerClick="Click" />
    </form>
 
    <img src="http://www.java2s.com/style/logo.png" id="word_image" runat="server">
 </BODY>
 </HTML>








2.2.Event
2.2.1.Get action sender text (VB.net)
2.2.2.Report action trigger's text (VB)
2.2.3.Report action trigger's text (C#)
2.2.4.Change img border stype in Input Button action (VB.net)