HTML Controls ASP.Net Tutorial

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



    BulletedList Control


    
    

    

BulletedList Control


    
               OnClick="bltList_Click" 
          Target="_blank">
      rntsoft.com
      rntsoft.com
      
     
    
     
      
        
        
      

       
         
         
         
       
       
         
         
         
       
     

          BulletStyle
         

          FirstBulletNumber
         

          DisplayMode
         

          
            NotSet
            Numbered
            LowerAlpha
            UpperAlpha
            LowerRoman
            UpperRoman
            Disc
            Circle
            Square
            CustomImage
          
         

                          AutoPostBack=true 
                Width=50
                OnSelectedIndexChanged="lb_SelectedIndexChanged">
            1
            2
            3
            4
            5
            6
          
         

            
              NotSet
              Text
              HyperLink
              LinkButton
            
         

    

    


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 : System.Web.UI.Page 
{
    protected void lb_SelectedIndexChanged(object sender, EventArgs e){
     ListBox lb = (ListBox)sender;
     string strID = lb.ID;
     string strValue = lb.SelectedValue;
     switch (strID){
       case "lbBulletStyle": BulletStyle style = (BulletStyle)Enum.Parse(typeof(BulletStyle), strValue);
             bltList.BulletStyle = style;
             if (style == BulletStyle.CustomImage)
             {
                bltList.BulletImageUrl = "A.bmp";
             }
             break;
       case "lbFirstBulletNumber":
         bltList.FirstBulletNumber = Convert.ToInt32(strValue);
         break;
       case "lbDisplayMode":
             BulletedListDisplayMode displayMode = (BulletedListDisplayMode)Enum.Parse(typeof(BulletedListDisplayMode), strValue);
             bltList.DisplayMode = displayMode;
             break;
          default:
             break;
     }
   }
  protected void bltList_Click(object sender, BulletedListEventArgs e){
     BulletedList b = (BulletedList)sender;
     tdMessage.InnerHtml = "Selected index: " + e.Index.ToString() +
        "
" +
        "Selected value: " + b.Items[e.Index].Value +
        "
";
  }
 }