asp.net 的ComboBox 可输入可选择下拉列表
文章出处:http://www.cnblogs.com/ejiyuan/archive/2007/11/09/954325.html
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Collections;
using System.Web.UI.Design;
[assembly: TagPrefix("AtomNet.Web.UI.WebControls", "AtomNet")]
namespace AtomNet.Web.UI.WebControls
{
/// <summary>
/// Represents a control that allows the user to select a single item from a drop-down list,
/// or type in a new value that is not in the list.
/// </summary>
/// <remarks>
/// Since the ComboBox control inherits from <see cref="System.Web.UI.WebControls.ListBox"/>,
/// you can use it in exactly the same manner (including DataBinding).
/// For older browsers that do not support the functionality required to render this control,
/// a normal dropdown box will be emitted instead.
/// </remarks>
[ToolboxData("<{0}:ComboBox runat=\"server\"></{0}:ComboBox>")]
[ValidationPropertyAttribute("SelectedValue")]
[Designer(typeof(AtomNet.Web.UI.WebControls.ComboBoxDesigner))]
public class ComboBox : System.Web.UI.WebControls.ListBox
{
#region 私有属性
/// <summary>
/// The <see cref="System.Web.UI.WebControls.TextBox"/> used internally to allow the user
/// to type in new values.
/// </summary>
TextBox textBox = new TextBox();
相关文档:
javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElement;
var objs = document.getElementsByTagName('INPUT');
for(var i=0; i< objs.length; i++)
{
if(objs[i].type.toLowerCase() == 'submit')
{
objs[i].disabled = true;
}
}
......
private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToString( ) ); } 第二:
private void Button2_Click( object sender, System.EventArgs e ) { Response.Write( " < script language=javascript>window.location.href=document.URL; < /script>" ); } ......
通过使用 ASP.NET 验证控件,可以使用逻辑运算符对照一个特定值来验证用户输入。例如,您可以指定用户输入必须是“1950 年 1 月 1 日”之后的日期,或是一个大于等于 0 的整数值。或者,您还可以指定将用户输入与另一控件的值进行比较。
1、将 CompareValidator 控件添加到页� ......
如果用户使用的浏览器支持动态 HTML (DHTML),则 ASP.NET 验证控件可以使用客户端脚本来执行验证。因为这种控件可以提供及时反馈(无需到服务器的往返过程),所以用户会感觉到页的性能有所改善。
在大多数情况下,无需对页或验证控件作出任何更改便可使用客户端验证。控件将自动检测浏� ......
Asp.net设计时经常要在.aspx.cs代码中写一些脚本,每次都重新写比较麻烦,所以把经常用的整理了一下,写成一个公共类,以便以后调用.
using System.Text;
using System.Web;
using System.Web.UI; namespace Lmsoft.Net.Web
{
/**//// <summary>
/// 文件名: Js.cs ......