title: How can I get the highest value from asp.net arraylist
body: <p>I am using VS2008, and ASP.NET 3.5 C#</p>
  
  <p>I have an array list that is populated using a textBox &amp; button for input of numbers.</p>
  
  <p>After clicking the button, I need to display the highest number in the arraylist.<br>
  So far I know I need a loop to compare the the items within the arraylist.</p>
  
  <pre><code>    using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using System.Web.UI;
      using System.Web.UI.WebControls;
      using System.Collections;
  
      public partial class Default4 : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
              ArrayList basket;
  
              basket = (ArrayList)(Session["basket"]);
  
              lblPrintOut.Text = "";
              for (int x = 0; x &lt; basket.Count; x++)
              {
                 //In here i need to make sure that I 
                 //compare the all the values with each other.
                 //My question is HOW?
              }
           }
       }
  </code></pre>
  
  <p>Should I maybe use a <code>.SORT</code> and then somehow pick the highest number on the list?    What do you guys think?</p>