ASP Net Controls ASP.Net Tutorial

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs"  Inherits="Default_aspx" %>



    Image Control


    
    

    

Image Control


     
    
      
     
     
     
     
     
     
     
         
         
         
         
         
         
         
         
         
     
    

    


File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Default_aspx : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
     switch (ddl.SelectedIndex)
     {
       case 0:
         img1.ImageAlign = ImageAlign.NotSet;
         img2.ImageAlign = ImageAlign.NotSet;
         break;
       case 1:
         img1.ImageAlign = ImageAlign.AbsBottom;
         img2.ImageAlign = ImageAlign.AbsBottom;
         break;
       case 2:
         img1.ImageAlign = ImageAlign.AbsMiddle;
         img2.ImageAlign = ImageAlign.AbsMiddle;
         break;
       case 3:
         img1.ImageAlign = ImageAlign.Top;
         img2.ImageAlign = ImageAlign.Top;
         break;
       case 4:
         img1.ImageAlign = ImageAlign.Bottom;
         img2.ImageAlign = ImageAlign.Bottom;
         break;
       case 5:
         img1.ImageAlign = ImageAlign.Baseline;
         img2.ImageAlign = ImageAlign.Baseline;
         break;
       case 6:
         img1.ImageAlign = ImageAlign.Middle;
         img2.ImageAlign = ImageAlign.Middle;
         break;
       case 7:
         img1.ImageAlign = ImageAlign.TextTop;
         img2.ImageAlign = ImageAlign.TextTop;
         break;
       case 8:
         img1.ImageAlign = ImageAlign.Left;
         img2.ImageAlign = ImageAlign.Left;
         break;
       case 9:
         img1.ImageAlign = ImageAlign.Right;
         img2.ImageAlign = ImageAlign.Right;
         break;
       default:
         img1.ImageAlign = ImageAlign.NotSet;
         img2.ImageAlign = ImageAlign.NotSet;
         break;
     }
    }
}