首页 / 网页编程 / ASP.NET / Asp.net 3.5控件和组件开发技术系列—从零开始开发服务器控件(下)
Asp.net 3.5控件和组件开发技术系列—从零开始开发服务器控件(下)2011-07-09 csdn博客 ChengKingTextBoxHeight属性主要用来设置显示值的子控件TextBox的高度。与LabelHeight功能相似。/// <summary>
/// 获得本书更多内容,请看:
/// http://blog.csdn.net/ChengKing/archive/2008/08/18/2792440.aspx
/// </summary>
private Unit unitTextBoxHeight = Unit.Empty;
[Category("LabelTextBox")]
[Description("文本框宽度")]
public Unit TextBoxHeight
{
get
{
this.EnsureChildControls();
return this.tb.Height;
}
set
{
this.EnsureChildControls();
this.tb.Height = value;
}
}ValidateExpression属性主要用来设置验证子控件的验证表达式,属性值为字符串类型。这里 是把验证子控件接口直接暴露给Field控件,比如,如果要验证一个表示输入邮件的字段,可以为 该属性设置值为:"w+([-+."]w+)*@w+([-.]w+)* .w+([-.]w+)*"(表示E-mail的正则表达 式)来验证用户输入值是否是合法E-mail格式。验证表达式不属于本书要介绍的内容,一般的 ASP.NET相关书籍都会有介绍。/// <summary>
/// 获得本书更多内容,请看:
/// http://blog.csdn.net/ChengKing/archive/2008/08/18/2792440.aspx
/// </summary>
[Category("LabelTextBox")]
[Description("验证表达式")]
public string ValidateExpression
{
get
{
this.EnsureChildControls();
return this.rev.ValidationExpression;
}
set
{
this.EnsureChildControls();
this.rev.ValidationExpression = value;
}
}