This documentation is archived and is not being maintained.

HtmlInputImage.Align Property

Gets or sets the alignment of the HtmlInputImage control in relation to other elements on the Web page.

[Visual Basic]
Public Property Align As String
[C#]
public string Align {get; set;}
[C++]
public: __property String* get_Align();
public: __property void set_Align(String*);
[JScript]
public function get Align() : String;
public function set Align(String);

Property Value

The alignment of the HtmlInputImage control in relation to other elements on the Web page.

Remarks

Use the Align property to specify the alignment of the HtmlInputImage control in relation to the other elements on the Web page. The following table lists the possible values for this property.

Alignment Value Description
Top The upper edge of the HtmlInputImage control is aligned with upper edge of the highest element on the same line.
Middle The middle of the HtmlInputImage control is aligned with the lower edge of the first line of text.
Bottom The lower edge of the HtmlInputImage control is aligned with the lower edge of the largest element on the same line.
Left The HtmlInputImage control is aligned with the left edge of the Web page.
Right The HtmlInputImage control is aligned with the right edge of the Web page.

Example

[Visual Basic, JScript] The following example demonstrates how to use the Align property to specify the alignment of the HtmlInputImage control in relation to other elements on the Web page.

[Visual Basic] 
<%@ Page Language="VB" AutoEventWireup="True" %>

<html>
   <script language="VB" runat=server>

      Sub SubmitBtn_Click(ByVal Source As Object, ByVal E as ImageClickEventArgs)
         Message.InnerHtml = "The Submit Button was clicked!"
      End Sub
 
      Sub ClearBtn_Click(ByVal Source As Object, ByVal E as ImageClickEventArgs)
         Message.InnerHtml = "The Clear Button was clicked!"
      End Sub

   </script>
 
   <body>

      <form method=post runat=server>

         <input type=image
                align="left" 
                src="Submit.jpg" 
                OnServerClick="SubmitBtn_Click" 
                runat=server>

         <input type=image 
                align="right" 
                src="Clear.jpg" 
                OnServerClick="ClearBtn_Click" 
                runat=server>
 
         <h1> <span id="Message" runat=server></span>
         </h1>

      </form>

   </body>

</html>


[JScript] 
<%@ Page Language="JScript" AutoEventWireup="True" %>

<html>
   <script language="JSCRIPT" runat=server>

      function SubmitBtn_Click(source : Object, e : ImageClickEventArgs){
         Message.InnerHtml = "The Submit Button was clicked!"
      }
 
      function ClearBtn_Click(source : Object, e : ImageClickEventArgs){
         Message.InnerHtml = "The Clear Button was clicked!"
      }

   </script>
 
   <body>

      <form method=post runat=server>

         <input type=image
                align="left" 
                src="Submit.jpg" 
                OnServerClick="SubmitBtn_Click" 
                runat=server>

         <input type=image 
                align="right" 
                src="Clear.jpg" 
                OnServerClick="ClearBtn_Click" 
                runat=server>
 
         <h1> <span id="Message" runat=server></span>
         </h1>

      </form>

   </body>

</html>

[C#, C++] No example is available for C# or C++. To view a Visual Basic or JScript example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

HtmlInputImage Class | HtmlInputImage Members | System.Web.UI.HtmlControls Namespace

Show: