linq - How to repeat an item to generate a sequence

Linq Repeat Operator - How to generate a sequence by repeating an item a given number of times
LinqRepeatOperator.aspx

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Linq" %>

<!DOCTYPE html>
<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        var repeatedText = Enumerable.Repeat("asp.net example",5);

        Label1.Text = "Repeated Item....... <br />";
        foreach (string s in repeatedText)
        {
            Label1.Text += s.ToString() + "<br />";
        }
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Linq Repeat Operator - How to generate a sequence by repeating an item a given number of times</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:DarkBlue; font-style:italic;">
            Linq Standard Query Operator
            <br /> Generation Operator - Repeat
            <br />How to generate a sequence by
            <br /> repeating an item a given number of times
        </h2>
        <hr width="425" align="left" color="CornFlowerBlue" />
        <asp:Label
             ID="Label1"
             runat="server"
             Font-Size="X-Large"
             ForeColor="DarkOrchid"
             Font-Italic="true"
             >
        </asp:Label>
        <br />
        <asp:Button 
            ID="Button1"
            runat="server"
            OnClick="Button1_Click"
            Text="Test Linq Query Operator - Repeat"
            Height="45"
            Font-Bold="true"
            ForeColor="DodgerBlue"
            />
    </div>
    </form>
</body>
</html>
More c# linq examples