本文介绍了保存记录时如何找到Runtime TextBox10 id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在此代码中,如何在运行时查找Textbox10 id,因为这是运行时生成的文本框.
我想保存在文本框中输入的记录.....
亲爱的团队帮我......
我有大问题……
In this code How I find Textbox10 id on runtime because this is runtime generate textbox .
I want to save record which I entered on textbox .....
Dear Team help me....
I have big issue......
RadioButton rdbuttn;
CheckBox chkList1;
TextBox txtbox;
int value = Convert.ToInt32(ddlNumberofAnswer.SelectedValue);
if (ddlAnswerType.SelectedValue == "2")
{
ddlNumberofAnswer.Enabled = true;
txtTextBox.Visible = false;
try
{
for (int intControlIndex = 0; intControlIndex < value; intControlIndex++)
{
chkList1 = new CheckBox();
txtbox = new TextBox();
chkList1.ID = "Chk" + intControlIndex;
txtbox.ID = "TextBox1" + intControlIndex;
chkList1.Font.Name = "Verdana";
chkList1.Font.Size = 9;
pnlPanel.Controls.Add(chkList1);
pnlPanel.Controls.Add(new LiteralControl("<br>"));
pnlPanel.Controls.Add(txtbox);
pnlPanel.Controls.Add(new LiteralControl("<br>"));
}
}
catch (Exception exp)
{
throw new Exception(exp.Message);
}
[Edited]代码被包装在"pre"标签中[/Edited]
Code is wrapped in "pre" tags[/Edited]
推荐答案
这篇关于保存记录时如何找到Runtime TextBox10 id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!