asnet实现购物车详细代码一节能
民生舆情 2020-10-22 09:03 字号: 大 中 小
<%@ Page language="c#" Codebehind="" AutoEventWireup="false" Inherits="oppingcart" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML> <HEAD>
<title>shoppingcart
</title>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312"> <LINK href="s" type="text/css" rel="stylesheet">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content=""> </HEAD>
<body> <center>
<form id="Form1" runat="server"> <table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <td>
<asp:DataGrid id="ShoppingCartDlt" runat="server" Width="500" BackColor="white" BorderColor="black" ShowFooter="false" CellPadding="3" CellSpacing="0" Font-Name="Verdana" Font-Size="8pt" HeaderStyle-BackColor="#cecfd6" AutoGenerateColumns="false" MaintainState="true"> <Columns>
<asp:TemplateColumn HeaderText="删除">
<ItemTemplate> <center>
<asp:CheckBox id="chkProductID" runat="server" /> </center>
</ItemTemplate> </asp:TemplateColumn>
<asp:BoundColumn DataField="ProdID" HeaderText="ID" />
<asp:BoundColumn DataField="ProName" HeaderText="商品名称" />
<asp:Boun我们总是看到索尼站在前台。但从这件事中dColumn DataField="UnitPrice" HeaderText="单价" />
<asp:TemplateColumn HeaderText="数量">
<ItemTemplate>
<asp:TextBox id="CountTb" runat="server" Text='<%#al( taItem,"ProdCount" )%>'> </asp:TextBox>
</ItemTemplate> </asp:TemplateColumn>
<asp:BoundColumn DataField="TotalPrice" HeaderText="小计( 元 )" /> </Columns> </asp:DataGrid></td> </tr> </table> <br> <table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <td>
<asp:Button id="update" runat="server" Text="更新我的购物车" CssClass="button2" /></td> <td>
<asp:Button id="CheckOut" runat="server" Text="结算" CssClass="button5" />
<input type="button" name="close2" value="继续购物" onClick="ose( );
return false;
" class="button2"></td> <td align="right"><br>
<asp:Label id="label" runat="server" Width="100px" Visible="True" ForeColor="#FF8080" Height="18px"></asp:Label></td> </tr> </table>
</form> </center>
</body></HTML>=======================================================================================以上为HTML页面部分
==========================================================================================
using System;
using llections;
using ponentModel;
using ssionState;
using b;
using ;
using mlControls;
using bControls;
using ta;
using eDb;
using nfiguration;
namespace myshop
{
/// <summary> /// shoppingcart 的摘要说明. /// </summary> public class shoppingcart : ge
{
protected taGrid ShoppingCartDlt;
protected tton update;
protected tton CheckOut;
protected mlForm Form1;
protected bel label;
protected eckBox chkProductID;
protected xtBox txtCount;
protected xtBox CountTb;
string AddProID;
private void Page_Load( object sender, entArgs e )
{
try
{
if ( Session["logon"]!="yes" Session["username"]==null )
{
direct( "m" ) ;
}
}
catch
{
direct( "m" ) ;
}
/////////////查看用户是否已经登陆.
if( !IsPostBack )
{
if( rams["mode"]=="view" ) //检测是否为直接查看购物车.
{
ViewShoppingCart( );
Caculator( );
}
if( rams["productID"]!=null rams["productID"]!="" )
{
AddProID=Req其老本行液晶显示器质量也一直备受消费者诟病。问题主要集中在液晶显示器使用半年左右出现屏幕不显示、电源灯不亮等问题。还有消费者在上抱怨称uest["productID"];
UpdateShoppingCart( );
Caculator( );
}
}
// 在此处放置用户代码以初始化页面
}
public void CreateCartTable( ) //创建购物车
{
DataSet ds = new DataSet( );
DataTable newDT=new DataTable( "CartTable" );
d( newDT );
DataColumn newDC;
newDC=new DataColumn( "ProdID",tType( "32" ) );
bles["CartTable"].d( newDC );
newDC=new DataColumn( "ProdCount",tType( "32" ) );
faultValue=1;
bles["CartTable"].d( newDC );
newDC=new DataColumn( "ProName",tType( "ring" ) );
bles["CartTable"].d( newDC );
newDC=new DataColumn( "UnitPrice",tType( "uble" ) );
bles["CartTable"].d( newDC );
newDC=new DataColumn( "TotalPrice",tType( "uble" ) );
bles["CartTable"].d( newDC );
newDC=new DataColumn( "IsDeleted",tType( "32" ) );
faultValue=0;
// public void WriteShoppingCart( ) 中 newDR[5]="0";
行,已被注销, bles["CartTable"].d( newDC );
Session["myCartTable"]=newDT;
taSource=bles["CartTable"].DefaultView;
taBind( );
}
查看本文来源
天水治疗白癜风花多少钱宝宝积食拉肚子小孩健脾的食物有哪些-
-
借助现阶段利好政策万宁将打造高端滨海度假
借助现阶段利好政策 万宁将打造高端滨海度假旅游基地借助现...
2020-08-13 | 民生舆情
-
-
埃梅里厄齐尔除了助攻还得进球欧联杯我要轮
埃梅里:厄齐尔除了助攻还得进球 欧联杯我要轮换埃梅里赛后...
2020-07-04 | 民生舆情
-
-
詹皇抠门那是詹韦秀恩爱NBA最抠门其实是搭配
詹皇抠门?那是詹韦秀恩爱 NBA最抠门其实是他邦纳 北...
2020-06-02 | 民生舆情
-
-
取关门主角松口表态想续约难道他真的长大了搭配
取关门主角松口表态想续约!难道他真的长大了考神最终会续...
2020-05-31 | 民生舆情
-
-
张世敏到我区调研社区建设
张世敏到我区调研社区建设8月30日,副市长张世敏到我区调研...
2019-07-16 | 民生舆情
-
-
港口区假日旅游市场繁荣
港口区假日旅游市场繁荣4月29日至5月1日,港口区天气晴好,...
2019-07-16 | 民生舆情