首页->博客空间->SpaceBuilderV1.0RC免安装版源码(51aspx调测)>>BasicWebControls/Channel/Search/SearchBlock.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilderV1.0RC免安装版源码(51aspx调测)
当前文件:
SpaceBuilderV10RC/BasicWebControls/Channel/Search/SearchBlock.cs[7K,2009-6-12 11:55:43],打开代码结构图
SpaceBuilderV10RC/BasicWebControls/Channel/Search/SearchBlock.cs[7K,2009-6-12 11:55:43],打开代码结构图1//------------------------------------------------------------------------------ 2
// <copyright company="Tunynet"> 3
// Copyright (c) Tunynet Network Technology Co., Ltd. All rights reserved. 4
// </copyright> 5
//------------------------------------------------------------------------------ 6
7
using System; 8
using System.Collections.Generic; 9
using System.Text; 10
using SpaceBuilder.Controls.BaseClasses; 11
using SpaceBuilder.Components; 12
using System.Web.UI.WebControls; 13
using SpaceBuilder.Configuration; 14
using SpaceBuilder.Bookmarks.Components; 15
using SpaceBuilder.Events.Components; 16
using TunyNet.Utils; 17
using SpaceBuilder.Clubs.Components; 18
using SpaceBuilder.Posts.Components; 19
20
namespace SpaceBuilder.Search.Controls 21
{ 22
public class SearchBlock : TemplatedWebControl 23
{ 24
SBContext wlContext = SBContext.Current; 25
protected override void OnInit(EventArgs e) 26
{ 27
if (SkinName == null) 28
ExternalSkinFileName = "/Searchs/Skin-SearchBlock.ascx"; 29
else 30
ExternalSkinFileName = SkinName; 31
32
base.OnInit(e); 33
} 34
35
Child Controls 42
43
protected override void AttachChildControls() 44
{ 45
keyword = FindControl("Keyword") as TextBox; 46
47
searchTypeDDL = FindControl("SearchTypeDDL") as DropDownList; 48
49
searchButton = FindControl("SearchButton") as Button; 50
searchButton.Click += new EventHandler(SearchButton_Click); 51
} 52
53
54
protected override void OnLoad(EventArgs e) 55
{ 56
base.OnLoad(e); 57
EnsureChildControls(); 58
if (!Page.IsPostBack) 59
{ 60
searchTypeDDL.Items.Clear(); 61
if (SBConfiguration.Instance().EnableSNS) 62
searchTypeDDL.Items.Add(new ListItem("会员", ((int)FullTextSearchType.PersonUser).ToString())); 63
64
if (SBConfiguration.Instance().EnableBlog) 65
searchTypeDDL.Items.Add(new ListItem("博客", ((int)FullTextSearchType.Blog).ToString())); 66
67
if (SBConfiguration.Instance().EnableGallery) 68
searchTypeDDL.Items.Add(new ListItem("图片", ((int)FullTextSearchType.Gallery).ToString())); 69
70
if (SBConfiguration.Instance().EnableFileGallery) 71
searchTypeDDL.Items.Add(new ListItem("文件", ((int)FullTextSearchType.FileGallery).ToString())); 72
73
if (SBConfiguration.Instance().EnableBookmark) 74
searchTypeDDL.Items.Add(new ListItem("网摘", ((int)FullTextSearchType.Bookmark).ToString())); 75
76
if (SBConfiguration.Instance().EnableForum || SBConfiguration.Instance().EnableClub) 77
searchTypeDDL.Items.Add(new ListItem("论坛", ((int)FullTextSearchType.Forum).ToString())); 78
79
if (SBConfiguration.Instance().EnableEvent) 80
searchTypeDDL.Items.Add(new ListItem("活动", ((int)FullTextSearchType.Event).ToString())); 81
82
if (SBConfiguration.Instance().EnableClub) 83
searchTypeDDL.Items.Add(new ListItem("圈子", ((int)FullTextSearchType.Club).ToString())); 84
} 85
} 86
87
事件 176
177
} 178
} 179
180






}
}