ASP.NET-如何动态生成标签 [英] ASP.NET - How to dynamically generate Labels

查看:92
本文介绍了ASP.NET-如何动态生成标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个关于机票预订系统的项目.我要输入旅行乘客的详细信息.这些乘客可能包括成人和儿童.因此,我需要为所有旅行的乘客动态生成单独的标签和文本框,以便可以输入所有标签和文本的详细信息.

I am doing a project on Flight Booking system. My part is to enter the details of the passengers travelling. These passengers may include Adults as well as children. So I need to dynamically generate separate labels and text boxes for all the passengers travelling so that details of all them can be entered.

我该怎么做?

推荐答案

您可能需要查看GridViews/DetailsView/Repeaters等. 然后,您可以编写一些数据绑定代码以根据需要为每个记录显示不同的标签.

You may want to look at GridViews / DetailsView / Repeaters etc. You can then write some databinding code to show the different labels for each record as required.

不过,正如其他人所说的那样,需要更多的信息来正确回答这个问题.也许您可以发布一些已经存在的代码,以便我们为您指明下一个方向.

As others have said though, a bit more information is needed to answer the question properly. Maybe you could post some of the code you have already so we can point you in the next direction.

这篇关于ASP.NET-如何动态生成标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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