如何在两列中拆分动态生成的文本框 [英] How to split the dynamically generated textboxes in two columns
问题描述
protected void Button1_Click(object sender,EventArgs e)
{
if(txtQuantity.Text!=)
{
for(int i = 0; i< Convert.ToInt16(txtQuantity.Text); i ++)
{
标签la =新标签();
la.Text = ddlProductName.SelectedItem.Value + i.ToString();
la.ID =abc+ i ;
PlaceHolder1.Controls.Add(la);
// la = FindControl(String。格式(i))作为标签;
TextBox txtbox = new TextBox();
// txtbox.Text =Textbox - + i.ToString();
PlaceHolder1.Controls.Add(new LiteralControl(< input id ='txt'name ='Textbox+ i +'type ='text'/>));
PlaceHolder1.Controls.Add(new LiteralControl(
));
}
}
}
大家好,
这是我的代码。我如何将gridview中动态生成的文本框分成两列。
protected void Button1_Click(object sender, EventArgs e)
{
if (txtQuantity.Text != "")
{
for (int i =0; i < Convert.ToInt16(txtQuantity.Text);i++ )
{
Label la = new Label();
la.Text = ddlProductName.SelectedItem.Value + i.ToString();
la.ID = "abc" +i;
PlaceHolder1.Controls.Add(la);
//la = FindControl(String.Format(i)) as Label;
TextBox txtbox = new TextBox();
// txtbox.Text = "Textbox - " + i.ToString();
PlaceHolder1.Controls.Add(new LiteralControl("<input id='txt' name='Textbox" + i + "'type='text' />"));
PlaceHolder1.Controls.Add(new LiteralControl("
"));
}
}
}
Hi Everyone,
This is my code. How will i split the dynamically generated textboxes in gridview into two columns.
推荐答案
这篇关于如何在两列中拆分动态生成的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!