




下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1/1在线购物网站核心设计-初中教育
1在线购物网站核心设计
一、商品扫瞄页面设计(default.aspx)
同理设定lblPriceDataBindingsText—Eval(“GoodsPrice”)image1ImageUrl—
Eval("GoodsPhoto")
同理设定“购买”链接按扭亏为盈LinkDatabindings—Eval(“GoodsID”)
“具体信息”的CommandName设置为"shopdescrbe"
“购买”的CommandName设置为"buy"
另外设置DataList1为水平2列显示。
publicpartialclass_Default:System.Web.UI.Page
{
protectedvoidPage_Load(objectsender,EventArgse)
{
stringconstr=WebConfigurationManager.ConnectionStrings["db_Conn"].ToString;
SqlConnectionconn=newSqlConnection(constr);
stringSqlstr="select*fromtb_GoodsInfo";
SqlDataAdapteradp=newSqlDataAdapter(Sqlstr,conn);
conn.Open;
DataSetds=newDataSet;
adp.Fill(ds);
DataList1.DataSource=ds.Tables[0];
DataList1.DataBind;
conn.Close;
}
protectedvoidDataList1_ItemCommand(objectsource,DataListCommandEventArgse)
{
if(5744f03167ec102de2bd8918mandName=="shopdescrbe")
{
stringstr_GoodsID=5744f03167ec102de2bd8918mandArgument.ToString;
Response.Redirect("shopdes_1.aspx?GoodsId="+str_GoodsID);
}
//完成登录登录窗口shopbuycart.asp再设计
if(5744f03167ec102de2bd8918mandName=="mybuy")
{
if(Session["UserId"]!=null)
{
stringstr_GoodsId=5744f03167ec102de2bd8918mandArgument.ToString;
Response.Redirect("shopbuycart.aspx?GoodsID="+str_GoodsId);
}
else
{
Response.Write("");
//Response.Redirect("Login.aspx");
}
}
}
}
运行结果:
2
二、商品具体页面设计(shopdes.aspx)
Txtintroduce:
usingSystem.Data.SqlClient;
publicpartialclassshopdes_1:System.Web.UI.Page
{
protectedvoidPage_Load(objectsender,EventArgse)
{
stringstr_GoodsID=Request["GoodsID"];
stringconstr="server=.\\sqlexpress;database=db_NetShop;integratedsecurity=true";
SqlConnectionconn=newSqlConnection(constr);
stringSqlstr="select*fromtb_GoodsInfowhereGoodsID='"+str_GoodsID+"'";
SqlDataAdapteradp=newSqlDataAdapter(Sqlstr,conn);
conn.Open;
DataSetds=newDataSet;
adp.Fill(ds);
3
lblname.Text=ds.Tables[0].Rows[0][1].ToString;
lbltype.Text=ds.Tables[0].Rows[0][2].ToString;
lblprice.Text=ds.Tables[0].Rows[0][4].ToString;
Image1.ImageUrl=ds.Tables[0].Rows[0][3].ToString;
txtintroduce.Text=ds.Tables[0].Rows[0][5].ToString;
conn.Close;
protectedvoidButton1_Click(objectsender,EventArgse)
{
Response.Redirect("Default.aspx");
}
protectedvoidButton2_Click(objectsender,EventArgse)
{
Response.Write("");
}
}
由商品扫瞄页面运行结按具体信息按钮运行结果:
三、会员登录页面
usingSystem.Data.SqlClient;
publicpartialclassLogin:System.Web.UI.Page
{
privatestringGenerateCheckCode
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 健康养老展服务博览会方案
- 项链说课课件2017
- 《旅行社经营管理》课件-第三章 旅行社产品开发设计
- 音标教学课件
- 人民警察法制教育
- 城镇污水管网建设工程建设管理方案(模板范文)
- 健康饮食产业园项目投标书(参考)
- xx河流排水防涝设施建设项目可行性研究报告
- 先锋问答知识:政治建设题库考点(题库版)
- 2025年锂电池正极材料合作协议书
- 2024年广州市荔湾区社区专职招聘笔试真题
- 《人工智能基础与应用》课件 项目1 认识人工智能
- 网络货运安全管理制度
- 2025至2030全球及中国溴化聚苯乙烯(BPS)行业发展趋势分析与未来投资战略咨询研究报告
- 校园外卖公司管理制度
- BA系统对电气设备动力柜(箱)的自控接口要求
- 汕尾市市直单位招聘政府聘员笔试真题2024
- 辽宁省铁岭市铁岭县2023-2024学年七年级下学期7月期末考试地理试卷(含答案)
- 房颤患者用药护理
- 2025年全国统一高考数学试卷(全国二卷)
- 无菌技术及手卫生
评论
0/150
提交评论