




下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1/1在線購物網(wǎng)站核心設計-初中教育
1在線購物網(wǎng)站核心設計
一、商品掃瞄頁面設計(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");
}
}
}
}
運行結(jié)果:
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("");
}
}
由商品掃瞄頁面運行結(jié)按具體信息按鈕運行結(jié)果:
三、會員登錄頁面
usingSystem.Data.SqlClient;
publicpartialclassLogin:System.Web.UI.Page
{
privatestringGenerateCheckCode
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 今年福建省高三省質(zhì)檢語文作文
- 住院患者護理健康宣教
- 氧氣吸入療法操作指南
- 二年級數(shù)學100以內(nèi)口算1000題
- 小學一年級數(shù)學20以內(nèi)加減法口算訓練300題
- 貴州省遵義市紅花崗區(qū)2025年中考語文一模試卷(含答案)
- 武漢鐵路職業(yè)技術(shù)學院《大數(shù)據(jù)與生物信息學(含操作)》2023-2024學年第二學期期末試卷
- 奎屯市2025屆四年級數(shù)學第二學期期末考試試題含解析
- 興安市重點中學2025年高三第一期中調(diào)研測試化學試題含解析
- 四川省遂寧城區(qū)五校聯(lián)考2025屆初三第一次診斷性測試數(shù)學試題理試題含解析
- 圖書館建筑設計規(guī)范講解課件
- 四川省教師資格認定體檢表
- 婚喪嫁娶事宜備案表
- 培養(yǎng)中班幼兒正確使用筷子的研究的結(jié)題報告
- 湘教版七年級上冊等高線地形圖
- 車間改造合同范文
- 風生水起博主的投資周記
- 賽艇賽事活動推廣方案
- (通用)中考數(shù)學總復習 第三章 函數(shù) 第4節(jié) 反比例函數(shù)課件 新人教
- 屋面開洞施工方案,好(全面完整版)
- 涂層厚度檢測記錄(共10頁)
評論
0/150
提交評論