Asp.net源码专业站
首页->博客空间->SpaceBuilder v1.1源代码>>BasicWebControls/Channel/Search/SearchBlock.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilder v1.1源代码
当前文件:文件类型 SpaceBuider11/BasicWebControls/Channel/Search/SearchBlock.cs[7K,2009-6-12 11:54:32]打开代码结构图
普通视图
		            
1//------------------------------------------------------------------------------ 2// <copyright company="Tunynet"> 3// Copyright (c) Tunynet Inc. All rights reserved. 4// </copyright> 5//------------------------------------------------------------------------------ 6 7using System; 8using System.Collections.Generic; 9using System.Text; 10using SpaceBuilder.Controls.BaseClasses; 11using SpaceBuilder.Components; 12using System.Web.UI.WebControls; 13using SpaceBuilder.Configuration; 14using SpaceBuilder.Bookmarks.Components; 15using SpaceBuilder.Events.Components; 16using TunyNet.Utils; 17using SpaceBuilder.Clubs.Components; 18using SpaceBuilder.Posts.Components; 19 20namespace SpaceBuilder.Search.Controls 21{ 22 /// <summary> 23 /// 搜索模块 24 /// </summary> 25 public class SearchBlock : TemplatedWebControl 26 { 27 SBContext wlContext = SBContext.Current; 28 protected override void OnInit(EventArgs e) 29 { 30 if (SkinName == null) 31 ExternalSkinFileName = "/Searchs/Skin-SearchBlock.ascx"; 32 else 33 ExternalSkinFileName = SkinName; 34 35 base.OnInit(e); 36 } 37 38 Child Controls 53 54 /// <summary> 55 /// 附加子控件 56 /// </summary> 57 protected override void AttachChildControls() 58 { 59 keyword = FindControl("Keyword") as TextBox; 60 61 searchTypeDDL = FindControl("SearchTypeDDL") as DropDownList; 62 63 searchButton = FindControl("SearchButton") as Button; 64 searchButton.Click += new EventHandler(SearchButton_Click); 65 } 66 67 68 protected override void OnLoad(EventArgs e) 69 { 70 base.OnLoad(e); 71 EnsureChildControls(); 72 if (!Page.IsPostBack) 73 { 74 searchTypeDDL.Items.Clear(); 75 if (SBConfiguration.Instance().EnableSNS) 76 searchTypeDDL.Items.Add(new ListItem("会员", ((int)FullTextSearchType.PersonUser).ToString())); 77 78 if (SBConfiguration.Instance().EnableBlog) 79 searchTypeDDL.Items.Add(new ListItem("博客", ((int)FullTextSearchType.Blog).ToString())); 80 81 if (SBConfiguration.Instance().EnableGallery) 82 searchTypeDDL.Items.Add(new ListItem("图片", ((int)FullTextSearchType.Gallery).ToString())); 83 84 if (SBConfiguration.Instance().EnableFileGallery) 85 searchTypeDDL.Items.Add(new ListItem("文件", ((int)FullTextSearchType.FileGallery).ToString())); 86 87 if (SBConfiguration.Instance().EnableBookmark) 88 searchTypeDDL.Items.Add(new ListItem("网摘", ((int)FullTextSearchType.Bookmark).ToString())); 89 90 if (SBConfiguration.Instance().EnableForum || SBConfiguration.Instance().EnableClub) 91 searchTypeDDL.Items.Add(new ListItem("论坛", ((int)FullTextSearchType.Forum).ToString())); 92 93 if (SBConfiguration.Instance().EnableEvent) 94 searchTypeDDL.Items.Add(new ListItem("活动", ((int)FullTextSearchType.Event).ToString())); 95 96 if (SBConfiguration.Instance().EnableClub) 97 searchTypeDDL.Items.Add(new ListItem("圈子", ((int)FullTextSearchType.Club).ToString())); 98 } 99 } 100 101 事件 190 191 } 192} 193 194
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:SpaceBuilder v1.1源代码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146