Ascx File:
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;
}
}
}
}
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; ///