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

📄 headerbase.cs

📁 基于.Net环境下c#实现的国人自己的Blog平台,基于.Text的核心技术,但做了汉化以及改写了一部分的核心代码,值得研究学习
💻 CS
字号:
#region Disclaimer/Info

///////////////////////////////////////////////////////////////////////////////////////////////////
// .Text WebLog
// 
// .Text is an open source weblog system started by Scott Watermasysk. 
// Blog: http://ScottWater.com/blog 
// RSS: http://scottwater.com/blog/rss.aspx
// Email: Dottext@ScottWater.com
//
// For updated news and information please visit http://scottwater.com/dottext and subscribe to 
// the Rss feed @ http://scottwater.com/dottext/rss.aspx
//
// On its release (on or about August 1, 2003) this application is licensed under the BSD. However, I reserve the 
// right to change or modify this at any time. The most recent and up to date license can always be fount at:
// http://ScottWater.com/License.txt
// 
// Please direct all code related questions to:
// GotDotNet Workspace: http://www.gotdotnet.com/Community/Workspaces/workspace.aspx?id=e99fccb3-1a8c-42b5-90ee-348f6b77c407
// Yahoo Group http://groups.yahoo.com/group/DotText/
// 
///////////////////////////////////////////////////////////////////////////////////////////////////

#endregion

using System;
using System.Web;
using System.Web.UI;

namespace Dottext.Web.Admin.WebUI
{
	public class HeaderBase : Control
	{
		private string _relativePath = String.Empty;
		private string _appPath;

		public HeaderBase()
		{
			_appPath = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) +
				HttpContext.Current.Request.ApplicationPath;
		}

		protected override void Render(HtmlTextWriter output)
		{
			output.Write(String.Format("<base href=\"{0}{1}/\" />", AppPath, RelativePath));
		}

		public string RelativePath
		{
			get { return _relativePath.StartsWith("/") ? _relativePath.Substring(1) : _relativePath; }
			set { _relativePath = value; }
		}

		public string AppPath
		{
			get { return _appPath.EndsWith("/") ? _appPath : _appPath + "/"; }
			set { _appPath = value; }
		}
	}
}

⌨️ 快捷键说明

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