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

📄 registeredusercontrol.cs

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.Security;
using System.Web.UI.WebControls;
using CommunityServer.Components;

namespace CommunityServer.Controls
{
	/// <summary>
	/// Summary description for AnonymousUserControl.
	/// </summary>
	public class RegisteredUserControl : TemplatedWebControl
	{
		public RegisteredUserControl()
		{
			//
			// TODO: Add constructor logic here
			//
		}

		Literal message = null;

		/// <summary>
		/// No Being Span
		/// </summary>
		/// <param name="writer"></param>
		public override void RenderBeginTag(System.Web.UI.HtmlTextWriter writer)
		{
			//we don't need a span tag
		}

		/// <summary>
		/// No End Span
		/// </summary>
		/// <param name="writer"></param>
		public override void RenderEndTag(System.Web.UI.HtmlTextWriter writer)
		{
			//we don't need a span tag
		}


		protected override void AttachChildControls()
		{
			message = FindControl("Message")	 as Literal;
			if(message != null)
				message.Text = String.Format( ResourceManager.GetString("DisplayUserWelcome_UserWelcome"), "<a href=\"" + Globals.GetSiteUrls().UserEditProfile + "\">" + CSContext.Current.User.Username + "</a>");

			switch(CSContext.Current.AuthenticationType)
			{

				case "passport":

					PlaceHolder passport = FindControl("PassportPanel") as PlaceHolder;
					if(passport != null)
						passport.Visible = true;					

					Literal lit = FindControl("PassportButton") as Literal;
					if(lit != null)
						lit.Text = (new PassportIdentity()).LogoTag() ;

					break;

				case "windows":

					PlaceHolder windows = FindControl("WindowsPanel") as PlaceHolder;
					if(windows != null)
						windows.Visible = true;					


					break;

				case "forms":
				default:

					PlaceHolder formspanel = FindControl("FormsPanel") as PlaceHolder;
					if(formspanel != null)
						formspanel.Visible = true;
					
					HyperLink logout = FindControl("logout") as HyperLink;
					if(logout != null)
					{
						logout.Text = ResourceManager.GetString("logout");
						logout.NavigateUrl = Globals.GetSiteUrls().Logout;
					}
					break;


			}

		}
	}
}

⌨️ 快捷键说明

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