I am using VS2008, and ASP.NET 3.5 C#
I have an array list that is populated using a textBox & button for input of numbers.
After clicking the button, I need to display the highest number in the arraylist.
So far I know I need a loop to compare the the items within the arraylist.
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 < basket.Count; x++)
{
//In here i need to make sure that I
//compare the all the values with each other.
//My question is HOW?
}
}
}
Should I maybe use a .SORT
and then somehow pick the highest number on the list? What do you guys think?