使用.net在下面创建的列表框中显示应用程序详细信息 [英] Diplay the application details in the below created listbox using .net

查看:52
本文介绍了使用.net在下面创建的列表框中显示应用程序详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是这个项目的新手,请帮助我.我的疑问是,例如,我创建了一个表单,例如姓名,地址,性别(使用单选按钮),提供的课程(使用下拉列表)和空列表框.当我单击提交按钮时,必须在给定的列表框中显示名称,地址,所选性别,所选课程.

I am new to the project.please kindly help me.My doubt is for example i had created a form like name,address,gender(using radio buttons),courses offered(using drop down list).and empty list box placed.and submit button.when i click on submit button that name,address,selected gender,selected course has to display in the given listbox.

推荐答案


试试以下

Hi
Try the following

your listbox id.Items.Add(your dropdownlist(s)id(s).SelectedItem.Text);



如果要同时添加文本和值的项目,请尝试以下操作



If you want to add items with both text and value then try the following

ListItem li = new ListItem(ddlTest.SelectedItem.Text, ddlTest.SelectedItem.Value);
            
            lboxTest.Items.Add(li);



希望对您有所帮助.



Hope this helps..


这篇关于使用.net在下面创建的列表框中显示应用程序详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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