protected void Page_Load(object sender, EventArgs e) { string qq = Request.QueryString["qq"].ToString(); int id = Convert.ToInt32(Request.QueryString["id"].ToString()); FillWriterInfo(qq); DealRightContent(id, qq); if (!IsPostBack) { HotArticleList.DataSource = new DAL.DArticle().GetByTotalReadTop8(); HotArticleList.DataBind(); GreatArticleList.DataSource = new DAL.DArticle().GetArticleByTitleAndTypeAndIsImportant("", "", 1); GreatArticleList.DataBind(); } }
protected void UserSearchBox_Click(object sender, EventArgs e) { DAL.DArticle DAr = new DAL.DArticle(); string key = UserNameText.Value; if (key.Equals(" 请输入作者名") || key.Equals("") || key.Contains("全部")) { UserNameText.Value = "全部"; HotArticleList.DataSource = DAr.GetAll(); HotArticleList.DataBind(); } else { HotArticleList.DataSource = DAr.GetArticleByTitleOrTypeOrName("", "", key); HotArticleList.DataBind(); } }