Showing posts with label Use in courses selection. Show all posts
Showing posts with label Use in courses selection. Show all posts

Thursday, August 9, 2018

how to use list box in asp.net | item selection Controls | Sradha Webcreations

how to use list box in asp.net | item selection Controls




using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class COMBO_BOX_DROPDOWN_ADD_REMOVE : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       ListBox1.Items.Add("INFORMATON TECHNOLOGY");
        ListBox1.Items.Add("C");
        ListBox1.Items.Add("C++");
        ListBox1.Items.Add("DOS");
        ListBox1.Items.Add("VB");
        ListBox1.Items.Add("CORE JAVA");
        ListBox1.Items.Add("ADVANCE JAVA");
        ListBox1.Items.Add("WEB TECHNOLOGY");
        ListBox1.Items.Add("ADDA");
        ListBox1.Items.Add("MANAGEMENT ACCOUNTING");
        ListBox1.Items.Add("OPERATION RESEARCH");
        ListBox1.Items.Add("SOFTWARE ENGINEERING");
        ListBox1.Items.Add("DBMS");
        ListBox1.Items.Add("RDBMS");
        ListBox1.Items.Add("SQL SERVER");
        ListBox1.Items.Add("ORACLE");
        ListBox1.Items.Add("MY SQL");
        ListBox1.Items.Add("PL/SQL");
        ListBox1.Items.Add("PHP");
        ListBox1.Items.Add(".NET");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        ListBox2.Items.Remove(ListBox2.SelectedItem.Text);    

    }
    protected void ButtonADD_Click(object sender, EventArgs e)
    {
        ListBox2.Items.Add(ListBox1.SelectedItem.Text);

    }
}