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

📄 preferences.ascx.cs

📁 ASP.NET书籍自带的"网上书店销售系统",源码完全公开,没经过封装,都为CS文件,是学习.NET的好参考资料.
💻 CS
字号:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BookShop.Web.Controls {
	public abstract class Preferences : UserControl {
	
		protected System.Web.UI.WebControls.DropDownList listLanguage;
		protected System.Web.UI.WebControls.DropDownList listCategory;
		protected System.Web.UI.WebControls.CheckBox chkShowFavorites;
		protected System.Web.UI.WebControls.CheckBox chkShowBanners;

		// Control property to show list of language
		public string Language {
			get { return WebComponents.CleanString.InputText(listLanguage.SelectedItem.Value, 50); }
			set { 
				ListItem item = listLanguage.Items.FindByValue(value);
				if (item != null){
					item.Selected = true;
				}
			}
		}

		// Control property to show list of categorys
		public string Category {
			get { return WebComponents.CleanString.InputText(listCategory.SelectedItem.Value, 50); }
			set { 
				ListItem item = listCategory.Items.FindByValue(value);
				if (item != null){
					item.Selected = true;
				}
			}
		}

		// Control property to show checkbox for show favorites list
		public bool IsShowFavorites {
			get { return chkShowFavorites.Checked; }
			set { chkShowFavorites.Checked = value; }
		}

		// Control property to show checkbox for show banners
		public bool IsShowBanners {
			get { return chkShowBanners.Checked; }
			set { chkShowBanners.Checked = value; }
		}
	}
}

⌨️ 快捷键说明

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