沒有,WEBControl沒有~~~~,如果想有,就自己寫控件了...
解决方案 »
- .net 2.0邮件发送失败的问题
- “系统错误”
- 请问DISCUZZ NT这样的论坛,怎么样简单的实现简体/繁体双语呢?
- ASP.NET中如何实现文件加密传输?
- 100分! vs.net2003 中用的吴旗娃的分页控件在 vs.net2005 下要如何修改写法?
- ASP.NET 编辑的代码是不是能够被反编译呢
- **捡分了** 取DROPDOWNLIST的ID
- 如何在一html文件中插入一张图片,并且能文字环绕
- 有关在网页上显示曲线的问题
- 请问怎样取得ButtonColumn事件的id值
- 那位兄弟有做站点的原码,以及开发文档;帮帮我学习,此致,敬礼
- 在asp.net中cookie为什么只能存储有限的20组?多了就会丢失。怎么可以多存储?
自己往里填,
还有就是写代码。
^_^
{
/// <summary>
/// WebCustomControl1 的摘要说明。
/// </summary>
[DefaultProperty("Text"),
ToolboxData("<{0}:ComboBox runat=server></{0}:ComboBox>")]
[
Designer(typeof(WebControlLibrary.ComboBoxDesigner)),
ValidationProperty("Text"),
]
public class ComboBox : System.Web.UI.WebControls.ListControl, IPostBackDataHandler, INamingContainer
{ /// <summary>
/// Creates a new instance of the ComboBox control.
/// </summary>
public ComboBox() : base() {}
#region Events
/// <summary>
/// The event which occurs when the <see cref="Text"/> property is changed.
/// </summary>
public event EventHandler TextChanged;
/// <summary>
/// Raises the <see cref="TextChanged"/> event.
/// </summary>
/// <param name="e">The data for the event.</param>
protected virtual void OnTextChanged( EventArgs e )
{
if ( TextChanged != null )
{
TextChanged( this, e );
}
}
#endregion #region Implementation of IPostBackDataHandler
void IPostBackDataHandler.RaisePostDataChangedEvent()
{
OnSelectedIndexChanged(System.EventArgs.Empty);
} bool IPostBackDataHandler.LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
{
// No need to check for the text portion changing. That is handled automagically bool listIndexChanged = false;
if( TextIsInList )
{
ListItem selectedItem = this.Items.FindByText(text.Text);
Int32 selectedIndex = Items.IndexOf( selectedItem );
if ( this.SelectedIndex != selectedIndex )
{
listIndexChanged = true;
this.SelectedIndex = selectedIndex;
}
}
else
{
if ( this.SelectedIndex != -1 )
{
listIndexChanged = true;
this.SelectedIndex = -1;
}
}
isLoaded = true;
return listIndexChanged;
}
#endregion
/// <summary>
/// Gets or sets the number of rows displayed in the dropdown portion of the <see cref="ComboBox"/> control.
/// </summary>
/// <value>
/// The number of rows displayed in the <see cref="ComboBox"/> control. The default value is 4.
/// </value>
[
Description("Gets or sets the number of rows of the dropdown portion of the ComboBox control."),
Category("Appearance"),
DefaultValue(4),
Bindable(true),
]
public virtual Int32 Rows
{
get
{
object savedRows; savedRows = this.ViewState["Rows"];
if (savedRows != null)
return (Int32) savedRows;
return 4;
}
set
{
if ( value < 1 )
{
throw new ArgumentOutOfRangeException();
}
this.ViewState["Rows"] = value;
} } /// <summary>
/// Gets or sets the text content of the text box portion of the <see cref="ComboBox"/> control.
/// </summary>
[
Description("Gets or sets the text content of the text box portion of the ComboBox control."),
Category("Appearance"),
Bindable(true),
DefaultValue("")
]
public virtual String Text
{
get
{
this.EnsureChildControls();
if ( text.Text == null )
{
return String.Empty;
}
return text.Text;
}
set
{
this.EnsureChildControls();
text.Text = value;
}
} /// <summary>
/// Gets a boolean value indicating whether the string in the text portion of the <see cref="ComboBox"/>
/// can be found in the text property of any of the ListItems in the Items collection.
/// </summary>
[
Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)
]
public virtual bool TextIsInList
{
get
{
this.EnsureChildControls();
return ( Items.FindByText( text.Text ) != null );
}
}
/// <summary>
/// Gets a boolean value indicating whether an external script library should be used,
/// instead of the library being emitted as a whole.
/// </summary>
protected virtual bool UseReferenceLibrary
{
get
{
return ( ReferenceLibraryUrl != String.Empty );
}
}
/// <summary>
/// Queries the web.config file to get the external reference script library path, if available.
/// </summary>
protected virtual String ReferenceLibraryUrl
{
get
{
NameValueCollection config = ConfigurationSettings.GetConfig("WebControlLibrary.ComboBox") as NameValueCollection;
if( config != null )
{
return config["ReferenceLibraryUrl"];
}
return String.Empty;
}
}
#endregion