动态添加文本框 [英] dynamically add text box

查看:67
本文介绍了动态添加文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我单击图像然后动态添加一个新文本框时?
请回答我
bye

解决方案

一个简单的google搜索为您提供了许多结果.

//Image Button onclick event
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
 TextBox TextBox1=new TextBox();
 TextBox1.ID="TextBox1";
 //..
}


我认为使用asease代码时,您必须指定父控件

//Image Button onclick event
protected void ImageButton1_Click(object sender, ImageClickEventArgs e){ 
TextBox TextBox1=new TextBox(); 
TextBox1.ID="TextBox1"; 
 // this line is 4 specifying Parent of TextBox1
TextBox1.Parent = SomeContainerControl;
}


检查此链接
在ASP.Net中创建动态文本框 [ ^ ]

when i click a image then add one new text box dynamically?
please answer me
bye

解决方案

A simple google search gives you number of results.

//Image Button onclick event
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
 TextBox TextBox1=new TextBox();
 TextBox1.ID="TextBox1";
 //..
}


I think with thease codes you must specify the parent control

//Image Button onclick event
protected void ImageButton1_Click(object sender, ImageClickEventArgs e){ 
TextBox TextBox1=new TextBox(); 
TextBox1.ID="TextBox1"; 
 // this line is 4 specifying Parent of TextBox1
TextBox1.Parent = SomeContainerControl;
}


Check this link
Creating Dynamic TextBox in ASP.Net[^]


这篇关于动态添加文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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