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

📄 controlheader.ascx.cs

📁 PetShop实现的是一个网上购物的系统功能
💻 CS
字号:
namespace PetShop.Web.Inc {

	using System;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;

	/// <summary>
	///	Displays the top portion of the page. Displays correct 
	///	images, logged in menus and navigation menu items.
	///	Props:
	///	 ShowMenu - true if menu should be shown, otherwise false.
	/// </summary>
	public partial  class ControlHeader : System.Web.UI.UserControl {

		// properties
		public bool ShowMenu = true;

		protected void Page_Load(object sender, System.EventArgs e) {
			ShowMenuArea();
			ShowLoggedInArea();
		}

		// display different items if person is logged in or not
		private void ShowLoggedInArea() {

			if (Request.IsAuthenticated == true) {
				areaLoggedIn.Visible = true;
				areaLoggedOut.Visible = false;
			}
			else {
				areaLoggedIn.Visible = false;
				areaLoggedOut.Visible = true;
			}
		}

		// hide or show menu items
		private void ShowMenuArea() {
			if (ShowMenu) {
				// show menu items
				areaMenu.Visible = true;
				lizard1.Visible = true;
				lizard4.Visible = true;
				lizard5.Visible = false;
				
				areaNoMenu.Visible = false;
			}
			else {
				// hide menu items
				areaMenu.Visible = false;
				lizard1.Visible = false;
				lizard4.Visible = false;				
				lizard5.Visible = true;

				areaNoMenu.Visible = true;
			}
		}

		#region Web Form Designer generated code
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {

		}

		protected void Page_Init(object sender, EventArgs e) {
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
		}

		public ControlHeader() {
			this.Init += new System.EventHandler(Page_Init);
		}
		#endregion
	}
}

⌨️ 快捷键说明

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