randomgallery.cs

来自「本系统是在asp版《在线文件管理器》的基础上设计制作」· CS 代码 · 共 60 行

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

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

namespace CommunityServer.Galleries.Controls
{
	/// <summary>
	/// Summary description for SidePortal.
	/// </summary>
	public class RandomGallery : GalleryBaseTemplatedWebControl
	{

		#region Child Controls

		private HyperLink nameLink;

		#endregion

		#region Skin

		protected override void AttachChildControls()
		{
			nameLink = (HyperLink)FindControl( "NameLink" );
		}

		#endregion

		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);
			if(!Page.IsPostBack)
				DataBind();
		}

		public override void DataBind()
		{
			base.DataBind();
			BindPortal();
		}

		public void BindPortal()
		{
			Gallery gallery = Galleries.GetRandomGallery();
			if(gallery != null)
			{
				nameLink.NavigateUrl = GalleryUrls.Instance().ViewGallery( gallery.ApplicationKey );
				nameLink.Text = gallery.Name;
			}
		}


	}
}

⌨️ 快捷键说明

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