ASP Net Controls ASP.Net Tutorial

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    private List groceries = new List();
    void Page_Load()
    {
        groceries.Add("Milk");
        groceries.Add("Steak");
        groceries.Add("Fish");
    }
    protected void Sort_Command(object sender, CommandEventArgs e)
    {
        if (e.CommandName == "Sort")
        {
            switch (e.CommandArgument.ToString())
            {
                case "ASC":
                    groceries.Sort(SortASC);
                    break;
                case "DESC":
                    groceries.Sort(SortDESC);
                    break;
            }
        }
    }
    void Page_PreRender()
    {
        bltGroceries.DataSource = groceries;
        bltGroceries.DataBind();
    }
    int SortASC(string x, string y)
    {
        return String.Compare(x, y);
    }
    int SortDESC(string x, string y)
    {
        return String.Compare(x, y) * -1;
    }



    Button Command


    
    

            id="btnSortAsc"
        Text="Sort ASC"
        CommandName="Sort"
        CommandArgument="ASC"
        OnCommand="Sort_Command"
        Runat="server" />
            id="btnSortDESC"
        Text="Sort DESC"
        CommandName="Sort"
        CommandArgument="DESC"
        OnCommand="Sort_Command"
        Runat="server" />
    
            id="bltGroceries"
        Runat="server" />