最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Literal控件与TextBox控件结合的自定义复合控件
时间:2022-06-30 11:12:55 编辑:袖梨 来源:一聚教程网
本控件主要解决了自定义复合控件中,客户端验证脚本。
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace Only.CompositionControls
{
///
/// Create By liyi。
/// Date:2004-10-10
///
[DefaultProperty("Value"),ValidationPropertyAttribute("Value"),ToolboxData("<{0}:LiteralTextBox runat=server>{0}:LiteralTextBox>")]
public class LiteralTextBox:Control,INamingContainer
{
//以下脚本用于从文本框输入页码
[DefaultValue("Text:"),Category("自定义")]
public string Text
{
get
{
this.EnsureChildControls();
return ((LiteralControl)Controls[0]).Text;
}
set
{
this.EnsureChildControls();
((LiteralControl)Controls[0]).Text = value;
}
}
[DefaultValue("Value"),Category("自定义")]
public string Value
{
get
{
this.EnsureChildControls();
return ((TextBox)Controls[1]).Text;
}
set
{
this.EnsureChildControls();
((TextBox)Controls[1]).Text = value;
}
}
[DefaultValue(""),Category("自定义")]
public Unit Width
{
get
{
this.EnsureChildControls();
return ((TextBox)Controls[1]).Width;
}
set
{
this.EnsureChildControls();
((TextBox)Controls[1]).自定义")]
public TextBoxMode TextMode
{
get
{
this.EnsureChildControls();
return ((TextBox)Controls[1]).TextMode;
}
set
{
this.EnsureChildControls();
((TextBox)Controls[1]).TextMode = value;
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace Only.CompositionControls
{
///
/// Create By liyi。
/// Date:2004-10-10
///
[DefaultProperty("Value"),ValidationPropertyAttribute("Value"),ToolboxData("<{0}:LiteralTextBox runat=server>{0}:LiteralTextBox>")]
public class LiteralTextBox:Control,INamingContainer
{
//以下脚本用于从文本框输入页码
[DefaultValue("Text:"),Category("自定义")]
public string Text
{
get
{
this.EnsureChildControls();
return ((LiteralControl)Controls[0]).Text;
}
set
{
this.EnsureChildControls();
((LiteralControl)Controls[0]).Text = value;
}
}
[DefaultValue("Value"),Category("自定义")]
public string Value
{
get
{
this.EnsureChildControls();
return ((TextBox)Controls[1]).Text;
}
set
{
this.EnsureChildControls();
((TextBox)Controls[1]).Text = value;
}
}
[DefaultValue(""),Category("自定义")]
public Unit Width
{
get
{
this.EnsureChildControls();
return ((TextBox)Controls[1]).Width;
}
set
{
this.EnsureChildControls();
((TextBox)Controls[1]).自定义")]
public TextBoxMode TextMode
{
get
{
this.EnsureChildControls();
return ((TextBox)Controls[1]).TextMode;
}
set
{
this.EnsureChildControls();
((TextBox)Controls[1]).TextMode = value;
相关文章
- 幻兽帕鲁流沙蛇去哪捕捉 帕鲁流沙蛇抓取方法介绍 07-12
- Web3遊戲《Seraph》代幣閃崩60%!官方緊急宣布回購$SERAPH 07-12
- 幻兽帕鲁滑水蛇怎么获得 帕鲁滑水蛇获取方法 07-12
- 原神玛薇卡恰斯卡队怎么配队 玛薇卡配队大全攻略 07-12
- 光遇水之灵怎么找-水之灵位置攻略 07-12
- 剑星拉毗服装如何获取 拉毗服装获取方式分享 07-12