⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 header.ascx.cs

📁 中国工商网电子商务购物中心系统EMall 软件介绍: 完全公开源代码,并无任何许可限制,特别基于大型电子商务网站的系统开发 Microsoft SQL Server 2000后台数据库
💻 CS
字号:
namespace EMall.UserControls
{
	///中国工商网.电子商务购物中心系统.EMall
///演示地址:http://emall.skysea.info
///演示界面:http://cs.12986.com/photos/sample/picture150.aspx

///中国工商网 -  http://www.12986.com
///Copyright (c) 1998-2005
///作者: Dili J.F. Senders

///技术支持:如果任何技术问题,请登录中国工商网技术支持网站咨询:http://cs.12986.com/

using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;

	/// <summary>
	///		Header 的摘要说明。
	/// </summary>
	public abstract class Header : System.Web.UI.UserControl
	{
		protected Pub pub = new Pub();
		protected System.Web.UI.WebControls.TextBox TextBox1;
		protected System.Web.UI.WebControls.DataList Datalist1;
		protected System.Web.UI.WebControls.DataList Datalist3;
		protected System.Web.UI.WebControls.Button Button1;

		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			BindData();
		}

		void BindData()
		{
			string sSQL;
			sSQL = "SELECT * FROM SiteMenu WHERE ParentID = 2 ORDER BY OrderID";
			pub.BindDataList(sSQL, Datalist1);
			sSQL = "SELECT * FROM Categories WHERE ParentID IS NOT NULL";
			pub.BindDataList(sSQL, Datalist3);

			sSQL = "SELECT TOP 10 * FROM Products ORDER BY Clicks DESC";
			// 从URL获取所选的ID
			string SelectedID = Request.Params["SelectedID"];
			if (SelectedID != null) 
			{
				Datalist3.SelectedIndex = Int32.Parse(SelectedID);
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		///		设计器支持所需的方法 - 不要使用
		///		代码编辑器修改此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.Button1.Click += new System.EventHandler(this.Button1_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void Button1_Click(object sender, System.EventArgs e)
		{
			string sStr = TextBox1.Text.Trim();
			if ((sStr != null) && (sStr.Length > 2))
			{
				Response.Redirect("SearchProducts.aspx?sStr=" + sStr, true);
			}
			else
				TextBox1.Text = "至少三位货号或者货名, 甚至描述也可以";
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -