ArrayList-Sitzung

Ich habe eine array-Liste wird gebildet, um jedes genre der Musik, zum Beispiel werde ich zeigen, country-Musik:

public class CountryItemList
{
    ArrayList CountryItems = new ArrayList();

    protected void CountryBuy1_Click(object sender, ImageClickEventArgs e)
    {
        CountryItems.Add("Johnny Cash - I Walk The Line - $9");
    }
    protected void CountryBuy2_Click(object sender, ImageClickEventArgs e)
    {
        CountryItems.Add("Carrie Underwood - Blown Away - $9");
    }
    protected void CountryBuy3_Click(object sender, ImageClickEventArgs e)
    {
        CountryItems.Add("Keith Urban - The Story So Far - $9");
    }

    protected void CountryBuy5_Click(object sender, ImageClickEventArgs e)
    {
        CountryItems.Add("Taylor Swift - Red - $11");
    }
    protected void CountryBuy6_Click(object sender, ImageClickEventArgs e)
    {
        CountryItems.Add("Willie Nelson - Legend - $9");
    }

}

}

für jedes buy-button, der geklickt wird, wird das ausgewählte album wird Hinzugefügt, um die array-Liste, aus der dann auf ich möchte den array-Liste in einer Sitzung, und führen Sie es über ein Listenfeld auf das "Warenkorb-Seite". Ich habe Probleme bei der Einnahme der array-Liste und machen es in einer Sitzung auf die nächste Seite

  • Irgendeinem Grund bist du mit ArrayList anstatt eine generische Sammlungen, für den Anfang?
  • Sie sollten wahrscheinlich machen CountryItems eine List<string> statt einer ArrayList.
InformationsquelleAutor user2246454 | 2013-04-04
Schreibe einen Kommentar