[不是问题] C#Web应用程序问题 [英] [Not a question] C # Web application Problem

查看:78
本文介绍了[不是问题] 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


这篇关于[不是问题] C#Web应用程序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆