温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilder v1.0正式版源码
当前文件:
SpaceBuiderV10Source/BlogControls/Views/BlogSideBar.cs,打开代码结构图
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
7
using SpaceBuilder.Blogs.Components; 8
using SpaceBuilder.Controls; 9
using System; 10
using System.Web.UI.WebControls; 11
using SpaceBuilder.Utils; 12
using SpaceBuilder.Components; 13
using TunyNet.Utils; 14
using SpaceBuilder.Tags.Controls; 15
using SpaceBuilder.Posts.Components; 16
17
namespace 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





}