[不是问题] C#Web应用程序问题

问题描述:

我想通过单击按钮删除ListBox和TextBox中存在的类似项目....



使用C#Web应用程序的编码... ...







例如



ListBox Have = 1,2,13,4,5,16

TextBox Have = 1,13,34,78



我想在单击Button后单击ListBox和TextBox(1,13)中的类似项目,但TextBox可能会满足所有项目。

I want to delete the similar item existing in both ListBox and TextBox by clicking a Button....

Using the Coding of C# Web Application......



For Example

ListBox Have = 1,2,13,4,5,16
TextBox Have = 1,13,34,78

I Want to remove the similar items exist both in ListBox and TextBox(1,13) from the ListBox after clicking a click of Button but TextBox may content all the items.

你可以检查列表框中的值是什么,将值获取到数组或索引值,如果是,则检查文本框值是否为equel。你也可以使用if else或数组。





谢谢
you can check the what are values in in list box get the values into array or index value and check the text box values are equels if yes delete it.you can use if else or arrays also.


thank you


for (int i = 0; i < LB_Selective.Items.Count; i++)
        {
            for (int j = 0; j < LB_TotalIEs.Items.Count; j++)
            {
                if (LB_TotalIEs.Items.Equals(LB_Selective.Items))
                {
                    Response.Write("Hello");
                }
                else
                {
                    LB_TotalIEs.Items.Remove(LB_Selective.Items.ToString());

                }
            }
        }


I delete the similar items from 2 list box 

Correct the coding