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;
}
}
......
·½·¨Ò»£º
string postData = string.Format("a=1&b=2"); //post´«µÝ²ÎÊý
Stream outstream = null;
Stream instream = null;
StreamReader sr = null;
&nb ......
ÔÚ.aspxÒ³ÃæÖÐÌí¼Ó£º
<SCRIPT LANGUAGE="javascript">
function SubmitKeyClick(button)
{
if (event.keyCode != 13) ;return;
{
eve ......
ͨ¹ýʹÓà ASP.NET ÑéÖ¤¿Ø¼þ£¬¿ÉÒÔʹÓÃÂß¼ÔËËã·û¶ÔÕÕÒ»¸öÌض¨ÖµÀ´ÑéÖ¤Óû§ÊäÈë¡£ÀýÈ磬Äú¿ÉÒÔÖ¸¶¨Óû§ÊäÈë±ØÐëÊÇ“1950 Äê 1 Ô 1 ÈÕ”Ö®ºóµÄÈÕÆÚ£¬»òÊÇÒ»¸ö´óÓÚµÈÓÚ 0 µÄÕûÊýÖµ¡£»òÕߣ¬Äú»¹¿ÉÒÔÖ¸¶¨½«Óû§ÊäÈëÓëÁíÒ»¿Ø¼þµÄÖµ½øÐбȽϡ£
1¡¢½« CompareValidator ¿Ø¼þÌí¼Óµ½Ò³Ö ......
ʹÓÃÑéÖ¤×é¿ÉÒÔ½«Ò³ÃæÉϵÄÑéÖ¤¿Ø¼þ¹éΪһ×é¡£¿ÉÒÔ¶Ôÿ¸öÑéÖ¤×éÖ´ÐÐÑéÖ¤£¬¸ÃÑéÖ¤ÓëͬһҳµÄÆäËûÑéÖ¤×éÎ޹ء£
½«Òª·Ö×éµÄËùÓпؼþµÄ ValidationGroup ÊôÐÔÉèÖÃΪͬһ¸öÃû³Æ£¨×Ö·û´®£©¼´¿É´´½¨ÑéÖ¤×é¡£¿ÉÒÔΪÑéÖ¤×é·ÖÅäÈκÎÃû³Æ£¬µ«±ØÐë¶Ô¸Ã×éµÄËùÓгÉԱʹÓÃÏàͬµÄÃû³Æ¡£
Ôڻط¢¹ý³ÌÖУ¬Ö» ......