ArrayList IndexOf() method with range in asp.net c#

ArrayList IndexOf() Method with range
ArrayListIndexOfMethodWithStartIndexAndCount.aspx

<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html>

<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        ArrayList colors = new ArrayList() { "ForestGreen", "Orange", "SkyBlue", "Navy", "Orange", "Olive" };

        Label1.Text = "ArrayList Elements....";
        Label1.Text += "<font color=SkyBlue>";
        foreach (string color in colors)
        {
            Label1.Text += "<br />" + color;
        }
        Label1.Text += "</font>";

        Label1.Text += "<br /><br />IndexOf(object Orange, startIndex 2, count 4)";
        Label1.Text += "<font color=Crimson>";
        Label1.Text += "<br />Index of 'Orange': " + colors.IndexOf("Orange", 2, 4);
        Label1.Text += "</font>";
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to use System.Collections.ArrayList IndexOf(Object, Int32, Int32) Method</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:MidnightBlue; font-style:italic;">
            System.Collections.ArrayList IndexOf(Object, Int32, Int32) Method
            <br /> How to search specified Object and get zero-based index of first
            <br /> occurrence within the range of elements in ArrayList that starts
            <br /> at specified index and contains specified number of elements
        </h2>
        <hr width="575" align="left" color="Navy" />
        <br />
        <asp:Label
             ID="Label1"
             runat="server"
             ForeColor="DarkOrchid"
             Font-Size="Large"
             Font-Names="Courier New"
             Font-Italic="true"
             Font-Bold="true"
             >
        </asp:Label>
        <br /><br />
        <asp:Button 
            ID="Button1"
            runat="server"
            OnClick="Button1_Click"
            Text="Test ArrayList IndexOf(Object, Int32, Int32) Method"
            Height="45"
            Font-Bold="true"
            ForeColor="DodgerBlue"
            />
    </div>
    </form>
</body>
</html>
More asp.net examples