AppMaster.master.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:3k
源码类别:
Email客户端
开发平台:
Visual C++
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using SearchGoods;
- public partial class AppMaster : System.Web.UI.MasterPage
- {
- goods gs = new goods();
- int gid;
- protected void Themepicker_Command(object sender, CommandEventArgs e)
- {
- //引发 Command 事件并允许直接处理 Command 事件。 在此事件中设定用户选择的主题.
- Profile.StylesheetTheme = e.CommandName;
- //Request.FilePath: 当前请求的虚拟路径。FilePath 属性不包括 PathInfo 尾端;例如,对于 URL:http://www.contoso.com/virdir/page.html/tail, FilePath 值为 /virdir/page.html。
- Response.Redirect(Request.FilePath, false);
- //HttpResponse.Redirect 方法 (String, Boolean) url目标位置。 endResponse指示当前页的执行是否应终止。
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Session["name"] != null)
- {
- Cart.Visible = true;
- Loginoutlnk.Visible = true;
- Loginlnk.Visible = false;
- Reglnk.Visible = false;
- String oid = Session["Login"].ToString();
- classDB db = new classDB();
- if (db.showOrder(oid) != 0)
- {
- showorder.Visible = true;
- }
- else
- {
- showorder.Visible = false;
- }
- }
- else {
- Cart.Visible = false;
- Loginoutlnk.Visible = false;
- Loginlnk.Visible = true;
- Reglnk.Visible = true;
- }
- }
- protected void Loginlnk_Click(object sender, EventArgs e)
- {
- Response.Redirect("Login.aspx");
- Loginlnk.Visible = false;
- Cart.Visible = true;
- Loginoutlnk.Visible = true;
- Reglnk.Visible = false;
- }
- protected void Loginoutlnk_Click(object sender, EventArgs e)
- {
- Session.RemoveAll();
- Response.Redirect("Default.aspx");
- }
- protected void Cart_Click(object sender, EventArgs e)
- {
- Response.Redirect("Cart.aspx");
- }
- protected void Reglnk_Click(object sender, EventArgs e)
- {
- Response.Redirect("reg.aspx");
- }
- protected void showorder_Click(object sender, EventArgs e)
- {
- Response.Redirect("OrderList.aspx");
- }
- protected void gosearch_btn_Click(object sender, EventArgs e)
- {
- gid = gs.GetGoodsID(goodsname_txt.Text);
- if (gid == 0)
- {
- Response.Write("<script>alert('没有找到你要找的商品!或者是你还没有登陆!登录可以得到更好的服务!');</script>");
- }
- else
- {
- //按产品名称查找商品
- Response.Redirect("ProductsList.aspx?id=" + gid + "");
- }
- }
- protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
- {
- Response.Redirect("ProductsList.aspx?id=" + GridView2.SelectedValue.ToString());
- }
- }