使用系统;
使用system.collections.generic;
使用system.componentmodel;
使用system.text;
使用的system.web;
使用system.web.ui程序;
使用system.web.ui.webcontrols;
system.collections中使用;
命名空间qc_control
{
///
///自定义可输入下拉框类
/// 摘要>
[toolboxdata(“ {0}:custominputdropdowncontrol>”) ]
公共类custominputdropdowncontrol:文本框
{
私人dropdownlist的ddllistitem =新的dropdownlist(); //下拉框
的私人文本框txtbox =新的textbox();
私人hashtable的_values =新的hashtable(); //用于绑定下拉框框的值
///
///键值引用变量设置/获取封装方法
/// 摘要>
公开hashtable的项目
{
获得{
如果(的viewstate [“值”] = = null)
{
的viewstate [“值”] =新的hashtable();
}
其他{}
hashtable的s =(哈希表)的viewstate [“值”];
返回s;
}
设置{的viewstate [“值”] =值; }
}
///
///默认构造函数
///初始化的dropdownlist和hashtable实例变量
/// 摘要>
公开custominputdropdowncontrol()
{
// this._values =新的hashtable();
// this.ddllistitem =新的dropdownlist();
}
///
///重写控件类渲染方法体
/// 摘要>
/// param>的
保护覆盖无效渲染(htmltextwriter的输出)
{ddllistitem。 id =“ddl”+ base.id;
txtbox.id =“txt」+ base.id;
//框架的开始
output.write(“
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号