ArrayList SetRange() method in asp.net c#

ArrayList.SetRange() Method
ArrayListSetRangeMethod.aspx

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

<!DOCTYPE html>

<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        ArrayList colors = new ArrayList() { "Red", "IndianRed", "PaleVioletRed", "DarkRed", "Lavender","Snow" };

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

        List<string> pinkColors = new List<string>() {"Pink","DeepPnk","HotPink" };
        colors.SetRange(2,pinkColors);

        Label1.Text += "<br /><br />List Elements(ICollection)....";
        Label1.Text += "<font color=SlateBlue>";
        foreach (string color in pinkColors)
        {
            Label1.Text += "<br />" + color;
        }
        Label1.Text += "</font>";

        Label1.Text += "<br /><br />After Call SetRange(index 2, ICollection) Method";
        Label1.Text += "<br />Now ArrayList Elements....";
        Label1.Text += "<font color=DeepPink>";
        foreach (string color in colors)
        {
            Label1.Text += "<br />" + color;
        }
        Label1.Text += "</font>";
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>ArrayList SetRange() - How to copy the elements of a collection over a range of elements in the ArrayList</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:MidnightBlue; font-style:italic;">
            System.Collections.ArrayList SetRange() Method
            <br /> How to copy the elements of a collection
            <br /> over a range of elements in the ArrayList
        </h2>
        <hr width="425" align="left" color="Navy" />
        <asp:Label
             ID="Label1"
             runat="server"
             ForeColor="DarkSalmon"
             Font-Size="Large"
             Font-Names="Courier New"
             Font-Italic="true"
             Font-Bold="true"
             >
        </asp:Label>
        <br />
        <asp:Button 
            ID="Button1"
            runat="server"
            OnClick="Button1_Click"
            Text="Test ArrayList SetRange() Method"
            Height="45"
            Font-Bold="true"
            ForeColor="DodgerBlue"
            />
    </div>
    </form>
</body>
</html>
More asp.net examples