关于Web自定义控件的问题,在线等
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Specialized;
namespace MyWebControls
{
[DefaultProperty( "Text ")]
[ToolboxData( " <{0}:LabelTextBox runat=server> </{0}:LabelTextBox> ")]
public class LabelTextBox : WebControl, IPostBackDataHandler, INamingContainer
{
public LabelTextBox()
: base( "input ")
{
Context.Trace.Write( "LabelTextBox ", "Created ");
}
private static readonly object _textChanged = new object();
public event EndEventHandler TextChanged
{
add { Events.AddHandler(_textChanged, value); }
remove { Events.RemoveHandler(_textChanged, value); }
}
[Bindable(true)]
[Category( "Appearance ")]
[DefaultValue( " ")]
[Localizable(true)]
public string Text
{
get
{
String s = (String)ViewState[ "Text "];
return ((s == null) ? String.Empty : s);
}
set
{
ViewState[ "Text "] = value;
}
}