您目前尚未登陆,请选择【登陆】或【注册
首页->新闻文章->多层文章管理系统源码>>Web/Controls/Search.ascx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:多层文章管理系统源码
当前文件:文件类型 MultiLayerArticle/Web/Controls/Search.ascx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11using SqlServerBLL; 12 13public partial class Controls_Search : System.Web.UI.UserControl 14{ 15 protected void Page_Load(object sender, EventArgs e) 16 { 17 if (!IsPostBack) 18 { 19 DataBindPage(); 20 } 21 } 22 private void DataBindPage() 23 { 24 Users userBLL = new Users(); 25 DataTable dtType = userBLL.GetAllType(); 26 ddlType.Items.Clear(); 27 ddlType.Items.Add(new ListItem("所有", "0")); 28 if (dtType != null) 29 { 30 for (int i = 0; i < dtType.Rows.Count; i++) 31 { 32 ddlType.Items.Add(new ListItem(dtType.Rows[i]["TypeName"].ToString(), dtType.Rows[i]["TypeID"].ToString())); 33 } 34 dtType.Dispose(); 35 } 36 if (Session["User"] != null) 37 { 38 this.PanelUserType.Visible = true; 39 } 40 } 41 protected void btnSearch_Click(object sender, EventArgs e) 42 { 43 string sUrl = "Article.aspx?PageIndex=0"; 44 string sName = tBoxTitle.Text.Trim(); 45 string sSummary = tBoxSummary.Text.Trim(); 46 string sType = ddlType.SelectedValue; 47 48 string sAll = "1"; 49 if (Session["User"] != null) 50 { 51 sAll = rBtnList.SelectedValue; 52 } 53 if (!string.IsNullOrEmpty(sName)) 54 { 55 sUrl += "&title=" + HttpUtility.UrlEncode(sName); 56 } 57 if (!string.IsNullOrEmpty(sSummary)) 58 { 59 sUrl += "&summary=" + HttpUtility.UrlEncode(sSummary); 60 } 61 if (!string.IsNullOrEmpty(sType) && Convert.ToInt32(sType) > 0) 62 { 63 sUrl += "&type=" + sType; 64 } 65 if (!string.IsNullOrEmpty(sAll)) 66 { 67 sUrl += "&check=" + sAll; 68 } 69 Response.Redirect(sUrl); 70 } 71} 72
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:多层文章管理系统源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号