社区
其它技术问题
帖子详情
怎么创建一个 System.Web.UI.WebControls.TextBox的对象
lingyu0607
2011-06-25 10:58:09
如题 我是要在Button的Onclick事件里创建 在线等 谢谢
...全文
77
2
打赏
收藏
怎么创建一个 System.Web.UI.WebControls.TextBox的对象
如题 我是要在Button的Onclick事件里创建 在线等 谢谢
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
pathuang68
2011-06-25
打赏
举报
回复
new一个就可以了。
楼主应该用的是C#吧,if so,
TextBox textBox = new TextBox(...);
lingyu0607
2011-06-25
打赏
举报
回复
我刚开始就是用的这个 做不到
简单的 留言板
using System; using System.Data; using System.Configuration; using System.Collections; using System.
Web
; using System.
Web
.Security; using System.
Web
.
UI
; using System.
Web
.
UI
.
Web
Controls
; using System.
Web
.
UI
.
Web
Controls
.
Web
Parts; using System.
Web
.
UI
.Html
Controls
; public partial class Default2 : System.
Web
.
UI
.Page { protected void Page_Load(object sender, EventArgs e) { Application.Lock(); string a = Application["chat"].ToString(); string[] b = a.Split(','); for (int i = 0; i <= b.Length - 1; i++) {
TextBox
1.Text =
TextBox
1.Text + "\r" + b[i].ToString(); } Application.UnLock(); Response.Write(DateTime.Now); } protected void
TextBox
1_TextChanged(object sender, EventArgs e) { } }
在页面设置自定义控中控件的大小
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.
Web
; using System.
Web
.Security; using System.
Web
.
UI
; using System.
Web
.
UI
.Html
Controls
; using System.
Web
.
UI
.
Web
Controls
; using System.
Web
.
UI
.
Web
Controls
.
Web
Parts; using System.Xml.Linq; public partial class test : System.
Web
.
UI
.UserControl { protected void Page_Load(object sender, EventArgs e) {
TextBox
1.Height = _txtheight;
TextBox
1.Width = _txtwidth;
TextBox
2.Height = _txtheight;
TextBox
2.Width = _txtwidth; Button1.Height = _labheight; Button1.Width = _labwidth; } private int _labheight; private int _labwidth; private int _txtheight; private int _txtwidth; public int laheight { get { return _labheight; } set { _labheight = value; } } public int labwidth { get { return _labwidth; } set { _labwidth = value; } } public int txtheight { get { return _txtheight; } set { _txtheight = value; } } public int txtwidth { get { return _txtwidth; } set { _txtwidth = value; } } protected void Button1_Click(object sender, EventArgs e) { Button1.Text = (Convert.ToInt32(
TextBox
1.Text) + Convert.ToInt32(
TextBox
2.Text)).ToString(); } }
TextBox
在 TextMode 属性设定成 MultiLine, MaxLength无效的解决方法
TextBox
在 TextMode 属性设定成 MultiLine, MaxLength无效的解决方法 在
Web
.config中 將以下片段插入到
web> /
下即可:
高级
textbox
继承System.
Web
.
UI
.
Web
Controls
.
TextBox
做出用功能强大的控件 包括完整
TextBox
、Numeric
TextBox
、Trim
TextBox
类,控件实现的功能有 浮动提示窗,自动验证,正则验证,数据输入限制等等。
ASPX向ASCX传值以及文本创建图片(附源码)
网页ASPX有一个
TextBox
,另一个ASCX有一个ImageButton,用户点一点这个铵钮,把用户在
TextBox
输入的文字创建为一个图片,ASCX的ImageButton的ImageUrl重新指向这刚产生的图片。为了传值,写一个接口,返回aspx的
TextBox
函数: 代码如下: using System; using System.Collections.Generic; using System.Linq; using System.
Web
; using System.
Web
.
UI
.
Web
Controls
; ///
/// Summary descriptio
其它技术问题
3,881
社区成员
9,056
社区内容
发帖
与我相关
我的任务
其它技术问题
C/C++ 其它技术问题
复制链接
扫一扫
分享
社区描述
C/C++ 其它技术问题
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章