⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comboboxbuilder.cs

📁 ASP C#代码实例 适合初学人士学习使用
💻 CS
字号:
using System;
using System.Web;
using System.Web.UI;

namespace WebCombobox {
	/// <summary>
	/// Summary description for ComboBoxBuilder.
	/// </summary>
	internal class ComboBoxBuilder : ControlBuilder {
		public ComboBoxBuilder(){
			//
			// TODO: Add constructor logic here
			//
		}
		public override bool AllowWhitespaceLiterals() {
			return false;
		} 
		
		public override Type GetChildControlType(string tagName, System.Collections.IDictionary attribs) {
			string szTagName = tagName.ToLower();
			int colon = szTagName.IndexOf(':');
			if ((colon >= 0) && (colon < (szTagName.Length + 1))) {
				// Separate the tagname from the namespace
				szTagName = szTagName.Substring(colon + 1, szTagName.Length - colon - 1);
			}
			if (String.Compare(szTagName, "option", true, System.Globalization.CultureInfo.InvariantCulture) == 0 ||
				String.Compare(szTagName, "listitem", true, System.Globalization.CultureInfo.InvariantCulture) == 0 ) {
				return typeof(System.Web.UI.WebControls.ListItem); 
			}
			// No Type was found, throw an exception
			throw new Exception(String.Format("Invalid child with tagname \"{0}\"", tagName));
		}

	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -