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

📄 siteheader.ascx.cs

📁 企业内部管理系统
💻 CS
字号:
namespace infoWeb.ThePhile.Web.Controls.User
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.Web.Security;

	using infoWeb.WebModules.Accounts.Business;

	/// <summary>
	///		Summary description for SiteHeader.
	/// </summary>
	public abstract class SiteHeader : System.Web.UI.UserControl
	{
		protected System.Web.UI.WebControls.Label Greeting;
		protected System.Web.UI.WebControls.LinkButton SignOut;
		protected System.Web.UI.WebControls.HyperLink UserLink;

		private void Page_Load(object sender, System.EventArgs e)
		{
			// Put user code to initialize the page here
			Greeting.Text = "欢迎你, ";
			if (Context.User.Identity.IsAuthenticated)
			{
				Greeting.Text += "<b>" + Context.User.Identity.Name + "</b>";
				UserLink.Text = "用户配置";
				UserLink.NavigateUrl = "/ThePhile/Modules/Users/MyAccount.aspx";
				SignOut.Visible = true;
			}
			else
			{
				Greeting.Text += "临时用户";
				UserLink.Text = "点击登录";
				UserLink.NavigateUrl = "/ThePhile/Modules/Users/Login.aspx";
				SignOut.Visible = false;
			}		
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.SignOut.Click += new System.EventHandler(this.SignOut_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void SignOut_Click(object sender, System.EventArgs e)
		{
			FormsAuthentication.SignOut();
			Response.Redirect("/thephile");
		}
	}
}

⌨️ 快捷键说明

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