付费下载
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年秋季初中新生军训 内务标准与技巧训练指南
- 2026年环保产业环保材料应用与市场前景报告
- 2026年邛安职业学院单招职业技能考试模拟试卷及参考答案详解【轻巧夺冠】
- 2027年日照山海职业学院单招综合素质考试模拟试卷(名校卷)附答案详解
- 2026年打印耗材行业商业模式创新报告
- 2027年临沂职业学院高职单招职业技能考试模拟试卷附答案详解AB卷
- 2025年河北深州职业学院高职单招职业适应性测试考试题库附参考答案详解(模拟题)
- 2024年河北太行生态职业学院单招职业技能考试题库附答案详解【培优】
- 2025年张家口桦皮岭学院高职单招职业适应性测试考试模拟试卷附答案详解(研优卷)
- 2025年临沂技师学院高职单招职业适应性测试考试模拟试卷含答案详解【达标题】
- 标准日本语初级下课后练习题答案25-48
- 农村建房包工包料施工合同
- 2024年江苏省张家港市文化中心管委办招聘3人历年(高频重点复习提升训练)共500题附带答案详解
- 多导睡眠监测课件
- 《复变函数与积分变换》第三版课后习题及答案
- 四川大学高等学历继续教育本科生毕业论文样本格式
- 交接班管理制度车间交接班制度生产车间交接班制度
- 仪器内校员培训教材
- 《中国石化建设工程招标投标规定》(完整版)资料
- JJF 1175-2021试验筛校准规范
- 中小学会计制度测试题及答案
评论
0/150
提交评论