controlpanelselectednavigation.cs

来自「community server 源码」· CS 代码 · 共 59 行

CS
59
字号
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI;

namespace CommunityServer.ControlPanel.Controls
{
	public class ControlPanelSelectedNavigation : Control
	{
		protected string SelectedTabQueryStringKey = "SelectedTab";
		protected string SelectedNavItemQueryStringKey = "SelectedNavItem";

		public ControlPanelSelectedNavigation()
		{
		}

		protected override void OnLoad(EventArgs e)
		{
			if (Page.Request.QueryString[SelectedNavItemQueryStringKey] != null)
				SelectedNavItem = Page.Request.QueryString[SelectedNavItemQueryStringKey];

			if (Page.Request.QueryString[SelectedTabQueryStringKey] != null)
				SelectedTab = Page.Request.QueryString[SelectedTabQueryStringKey];
			
			if (!CommunityServer.Components.Globals.IsNullorEmpty(this.SelectedTab))
				Context.Items["ControlPanelSelectedTab"] = this.SelectedTab;

			if (!CommunityServer.Components.Globals.IsNullorEmpty(this.SelectedNavItem))
				Context.Items["ControlPanelSelectedNavItem"] = this.SelectedNavItem;

			base.OnLoad (e);
		}

		private string _selectedTab = null;
		public string SelectedTab
		{
			get { return _selectedTab;}
			set
			{
				_selectedTab = value;
			}
		}

		private string _selectedNavItem = null;
		public string SelectedNavItem
		{
			get { return _selectedNavItem;}
			set
			{
				_selectedNavItem = value;
			}
		}
	}
}

⌨️ 快捷键说明

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