炫舞时代精灵捕捉:动态生成控件

来源:百度文库 编辑:高考问答 时间:2024/04/29 22:05:18
大家好,我做了一个考试系统,想动态生成一些label和textbox控件,来添加选择题的题面和学生的答案,并把学生的答案提交到数据库但生成textbox后总不能应用它的ID值,请高手帮忙。程序类似于下面的:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim i as integer
for i=0 to 5
dim textbox1 as new textbox()
textbox1.id="text"&i.tostring()

me1.controls.add("text"&i)
next
for i=0 to me1.controls.count-1
response.write(me1.controls(i).id)
next

end sub