下拉文件框的自定義控件
2004-11-30 16:47
435 查看
Ascx File:
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="TextDrop.ascx.cs" Inherits="CNetComPonents.UserControls.UCPowerTextBox" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
Ascx.Cs:
namespace CNetComPonents.UserControls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
///
/// WebUserControl1 腔晡猁佽隴﹝
///
public class UCPowerTextBox : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.TextBox UCTextBox;
protected System.Web.UI.WebControls.ListBox UCListBox;
private void Page_Load(object sender, System.EventArgs e)
{
// 婓森揭溫离蚚誧測鎢眕場宎趙珜醱
UCListBox.Style.Add("visibility","hidden");
}
#region Web 敦极扢數汜傖腔測鎢
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 蜆覃蚚岆 ASP.NET Web 敦极扢數垀斛剒腔﹝
//
InitializeComponent();
base.OnInit(e);
}
///
/// 扢數盓厥垀剒腔源楊 - 祥猁妏蚚測鎢晤憮
/// 党蜊森源楊腔囀﹝
///
private void InitializeComponent()
{
this.Page.Load +=new EventHandler(Page_Load);
this.UCListBox.Attributes["onclick"]="javascript:UCListBox_click();";
}
#endregion
public string Text
{
get
{
return UCTextBox.Text;
}
set
{
UCTextBox.Text = value;
}
}
public int Width
{
set
{
UCTextBox.Width = value;
UCListBox.Width = value;
}
}
public object DataSource
{
set
{
UCListBox.DataSource = value;
}
}
public string DataTextField
{
set
{
UCListBox.DataTextField = value;
}
}
public string DataValueField
{
set
{
UCListBox.DataValueField = value;
}
}
public new void DataBind()
{
UCListBox.DataBind();
}
public int Rows
{
set
{
UCListBox.Rows = value;
}
}
}
}
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="TextDrop.ascx.cs" Inherits="CNetComPonents.UserControls.UCPowerTextBox" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
Ascx.Cs:
namespace CNetComPonents.UserControls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
///
/// WebUserControl1 腔晡猁佽隴﹝
///
public class UCPowerTextBox : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.TextBox UCTextBox;
protected System.Web.UI.WebControls.ListBox UCListBox;
private void Page_Load(object sender, System.EventArgs e)
{
// 婓森揭溫离蚚誧測鎢眕場宎趙珜醱
UCListBox.Style.Add("visibility","hidden");
}
#region Web 敦极扢數汜傖腔測鎢
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 蜆覃蚚岆 ASP.NET Web 敦极扢數垀斛剒腔﹝
//
InitializeComponent();
base.OnInit(e);
}
///
/// 扢數盓厥垀剒腔源楊 - 祥猁妏蚚測鎢晤憮
/// 党蜊森源楊腔囀﹝
///
private void InitializeComponent()
{
this.Page.Load +=new EventHandler(Page_Load);
this.UCListBox.Attributes["onclick"]="javascript:UCListBox_click();";
}
#endregion
public string Text
{
get
{
return UCTextBox.Text;
}
set
{
UCTextBox.Text = value;
}
}
public int Width
{
set
{
UCTextBox.Width = value;
UCListBox.Width = value;
}
}
public object DataSource
{
set
{
UCListBox.DataSource = value;
}
}
public string DataTextField
{
set
{
UCListBox.DataTextField = value;
}
}
public string DataValueField
{
set
{
UCListBox.DataValueField = value;
}
}
public new void DataBind()
{
UCListBox.DataBind();
}
public int Rows
{
set
{
UCListBox.Rows = value;
}
}
}
}
相关文章推荐
- 在ASP.NET 2.0中操作数据之十二:在GridView控件中使用TemplateField
- Asp.Net 重定向必须要知道的一些资料
- 用 Asp.Net 建立一个在线 RSS 新闻聚合器的方法
- JavaScript封装的常用工具类库bee.js用法详解【经典类库】
- VC与Delphi之间动态链接库互相调用
- 我的应聘总结!
- Microsoft Visual Studio .NET 2003制作安装程序
- javascript表单之间的数据传递!
- PHP 的 MySQL 操作类,跟手册上的函数一样用,但是更方便了。多说无益,看了就知道了。
- Java测试规范(引用)
- Java面试题目
- 一个非常不错的业务规则管理器
- delphi中的时间操作技术(1)
- delphi中的时间操作技术(2)
- VB五子棋问题,请高手赐教
- IP地址的隐藏(delphi实现 )
- 解析IP地址为主机域名