您目前尚未登陆,请选择【登陆】或【注册
首页->博客论坛->SpaceBuilder v1.0正式版源码>>BlogControls/Views/BlogSideBar.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilder v1.0正式版源码
当前文件:文件类型 SpaceBuiderV10Source/BlogControls/Views/BlogSideBar.cs打开代码结构图
普通视图
		            
1//------------------------------------------------------------------------------ 2// <copyright company="Tunynet"> 3// Copyright (c) Tunynet Network Technology Co., Ltd. All rights reserved. 4// </copyright> 5//------------------------------------------------------------------------------ 6 7using SpaceBuilder.Blogs.Components; 8using SpaceBuilder.Controls; 9using System; 10using System.Web.UI.WebControls; 11using SpaceBuilder.Utils; 12using SpaceBuilder.Components; 13using TunyNet.Utils; 14using SpaceBuilder.Tags.Controls; 15using SpaceBuilder.Posts.Components; 16 17namespace SpaceBuilder.Blogs.Controls 18{ 19 /// <summary> 20 /// Summary description for BlogSideBar. 21 /// </summary> 22 public class BlogSideBar : WeblogThemedControl 23 { 24 Literal blogName; 25 Literal blogDescription; 26 27 Literal news; 28 29 TextBox postKeyword; 30 LinkButton blogSearchButton; 31 32 protected override void AttachChildControls() 33 { 34 blogName = FindControl("BlogName") as Literal; 35 blogDescription = FindControl("BlogDescription") as Literal; 36 37 news = FindControl("News") as Literal; 38 39 postKeyword = FindControl("PostKeyword") as TextBox; 40 blogSearchButton = FindControl("BlogSearchButton") as LinkButton; 41 blogSearchButton.Click += new EventHandler(BlogSearchButton_Click); 42 } 43 44 protected override void OnLoad(EventArgs e) 45 { 46 base.OnLoad(e); 47 EnsureChildControls(); 48 49 if (blogName != null && !ValueHelper.IsNullOrEmpty(CurrentWeblog.SectionName)) 50 blogName.Text = CurrentWeblog.SectionName; 51 52 if (blogDescription != null && !ValueHelper.IsNullOrEmpty(CurrentWeblog.Description)) 53 blogDescription.Text = CurrentWeblog.Description; 54 55 if (news != null) 56 news.Text = CurrentWeblog.News; 57 } 58 59 /// <summary> 60 /// 搜索博客文章 61 /// </summary> 62 protected void BlogSearchButton_Click(object sender, EventArgs e) 63 { 64 PostFullTextQuery query = new PostFullTextQuery(); 65 query.FullTextSearchType = FullTextSearchType.Blog; 66 query.SearchScopeUserID = CurrentDomainUser.UserID; 67 query.UserID = CurrentDomainUser.UserID; 68 //query.SectionID = CurrentWeblog.SectionID; 69 query.PostKeyword = postKeyword.Text; 70 string searchPostsUrl = Globals.FullPathForSearchSite(ChannelUrls.Instance().BlogSearchResults() + "?" + query.ConvertToQueryString()); 71 Context.Response.Redirect(searchPostsUrl, true); 72 } 73 74 75 } 76} 77
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:SpaceBuilder v1.0正式版源码