linq - How to get maximum value of a numeric sequence

Linq Max Operator - How to get the maximum number of a sequence of numbers
LinqMaxOperator.aspx

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

<!DOCTYPE html>
<script runat="server">
    protected void Button1_Click(object sender, System.EventArgs e)
    {
        int[] myNums = {27,26,19,56,47,23,33};

        Label1.Text = "Numbers List: <br />";

        foreach (int n in myNums)
        {
            Label1.Text += n.ToString() + "<br />";
        }

        Label2.Text = "Maximum Value in Numbers: " + myNums.Max().ToString(); ;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Linq Max Operator - How to get the maximum number of a sequence of numbers</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:DarkBlue; font-style:italic;">
            Linq Standard Query Operator - Max
            <br />How to get the maximum number
            <br /> of a sequence of numbers
        </h2>
        <hr width="375" align="left" color="CornFlowerBlue" />
        <asp:Label
             ID="Label1"
             runat="server"
             Font-Size="X-Large"
             ForeColor="IndianRed"
             Font-Italic="true"
             >
        </asp:Label>
        <br />
        <asp:Label
             ID="Label2"
             runat="server"
             Font-Size="X-Large"
             ForeColor="DodgerBlue"
             Font-Italic="true"
             >
        </asp:Label>
        <br /><br />
        <asp:Button 
            ID="Button1"
            runat="server"
            OnClick="Button1_Click"
            Text="Test Linq Query Operator - Max"
            Height="45"
            Font-Bold="true"
            ForeColor="DodgerBlue"
            />
    </div>
    </form>
</body>
</html>
More c# linq examples