如何在asp.net中动态显示文本框? [英] how to show textbox dynamically in asp.net?
本文介绍了如何在asp.net中动态显示文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的第一页中,我在(下拉[1 ... 9])中选择passanger,根据选择,一个下拉菜单包含title(mr,mrs ..)
一个用于姓氏的文本框和另一个用于姓氏的文本框将出现在第二页中.
请帮帮我,
如果我看到2个passanger的意思,则两个下拉菜单和四个textboxex应该出现在下一页.
In my first page, i select passanger in (dropdown [1...9]), based on the selection, a dropdown contains title(mr,mrs..)
a textbox for firstname and another one for lastname will appear in second page.
Please help me,
if i seelct 2 passanger means, two dropdown and four textboxex should appear in next page.
推荐答案
您正在寻找什么样的帮助?
根据选定的乘客数量,循环进入以创建控件并将其添加到页面.
伪步骤:
-从首页获取数据-乘客人数及其姓名
-对于0到数量的旅客
-为名字(TextBox tb = new TextBox();
)
创建一个新的textbox1 -定义ID,长度以及要为文本框定义的其他属性
-将此文本框添加到占位符/面板
-为第二个名字创建一个新的textbox2
-定义ID,长度以及要为文本框定义的其他属性
-将此文本框添加到占位符/面板
-转到下一个乘客-循环.
试试吧!
And what kind of help you are looking for?
Based on number of passengers selected, go in a loop to create control and add it to the page.
pseudo steps:
- Get data from first page - number of passengers and their name
- for 0 to numberofPassengers
- create a new textbox1 for first name(TextBox tb = new TextBox();
)
- define ID, length andy other property you want to define for the textbox
- Add this textbox to the placeholder/panel
- create a new textbox2 for second name
- define ID, length andy other property you want to define for the textbox
- Add this textbox to the placeholder/panel
- Go to next passenger - loop.
Try!
这篇关于如何在asp.net中动态显示文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文