what is the .net code for adding year in this form like 2001-2002,2002-2003, in dropdown with the asp.net

protected void Page_Load(object sender, EventArgs e)
    {
        this.DropDownList1.Items.Add("Orange");
        this.DropDownList1.Items.Add("Grapes");
        this.DropDownList1.Items.Add("Apple");
        this.DropDownList1.Items.Add("Mango");
        this.DropDownList1.Items.Add("Lemon");
        this.DropDownList1.Items.Add("Banana");

}

That can also be done in a simple for loop.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.