session and sorted list question in asp.net

Discussion in 'C#' started by progfrog, Jun 17, 2008.

  1. #1
    hi!


    something isn't working with the code and with the addition of an object to a sortedlist
    here is the code:
    
    
    
     protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            
            {
                SortedList my_products = new SortedList();
    
                Product p;
                p= new Product ("candels", 100, "01");
               
    [SIZE="1"]///THIS IS THE SORTED LIST[/SIZE]
     
    my_products.Add(p,p._id);
    
    [SIZE="1"]///THIS IS A DROPDOWN LIST          [/SIZE]
    
      ddlProducts.Items.Add(new ListItem(p._name,p._id));
    
    
      p=new Product("plate", 200, "02");
                
    [SIZE="1"]///AGAIN THE SORTED LIST[/SIZE]
    
    my_products.Add(p, p._id);
              
    [SIZE="1"]///THE DROP DOWN LIST[/SIZE]
    
      ddlProducts.Items.Add(new ListItem(p._name, p._id));
    
    
    
    
    
    
    
    Code (markup):

    THANX A LOT
     
    progfrog, Jun 17, 2008 IP