/// <summary>
/// 文本框值 txtMD是一个Web TextBox
/// </summary>
[Bindable(true),
Category("Appearance"),
DefaultValue("")]
public string Text
{
get
{
if(txtMD.Text!="")
return txtMD.Text;
else
return "";
}
set
{
txtMD.Text=value;
}
}
自定义属性:
/// <summary>
/// 参考录入窗口宽度
/// </summary>
[Bindable(true),
Category("Appearance"),
DefaultValue("50")]
public int TextBoxMaxLength
{
get
{
return ViewState[this.UniqueID+"TextBoxMaxLength"]==null?50:(int)ViewState[this.UniqueID+"TextBoxMaxLength"];
}
set
{
ViewState[this.UniqueID+"TextBoxMaxLength"]=value;
}
} |