asp.net购物车问题

谁能给个完整能运行的c#代码啊?谢谢了!... 谁能给个完整能运行的c#代码啊?谢谢了! 展开
 我来答
百度网友a549fe30a
2009-04-05 · 超过17用户采纳过TA的回答
知道答主
回答量:48
采纳率:0%
帮助的人:0
展开全部
<table style=" font-size: 9pt; font-family: 宋体; width:574px; height :806px; background-repeat :no-repeat; background-image: url(images/显示页面当前位置.jpg);">
<tr>
<td style ="height :20px" valign="middle" align="left">
<br /><br /> 
目前位置:首页 > 购物车
</td>
</tr>
<tr>
<td valign =top style ="height :786px" >
<table cellSpacing="0" cellPadding="0" width="95%" align="center" border="0" style="FONT-SIZE: 9pt">
<tr>
<td align="center">
<asp:Label ID="labMessage" runat="server" Visible="False"></asp:Label></td>
</tr>
<tr>
<td align="left" style="height: 30px">
<asp:Label ID="labTotalPrice" runat="server" Text="0.00 " ></asp:Label>¥</td>
</tr>
<tr style =" font :9pt; font-family :宋体;" valign =top >
<td align="left" style="height: 135px">

<asp:GridView ID="gvShopCart" DataKeyNames ="BookID" runat="server" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="gvShopCart_PageIndexChanging" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" >
<Columns>
<asp:BoundField DataField="No" HeaderText="序号" ReadOnly="True">
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="BookID" HeaderText="商品ID" ReadOnly="True">
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:BoundField DataField="BookName" HeaderText="商品名称" ReadOnly="True">
<ItemStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="数量">
<ItemTemplate >
<asp:TextBox ID="txtNum" runat="server" Text =<%#Eval("Num") %> Width =60px OnTextChanged="txtNum_TextChanged"></asp:TextBox>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtNum"
ErrorMessage="×" ValidationExpression="^\+?[1-9][0-9]*$"></asp:RegularExpressionValidator>
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText =单价>
<HeaderStyle HorizontalAlign=Center />
<ItemStyle HorizontalAlign =Center />
<ItemTemplate >
<%#Eval("price")%>¥
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText =总价>
<HeaderStyle HorizontalAlign=Center />
<ItemStyle HorizontalAlign =Center />
<ItemTemplate >
<%#Eval("totalPrice")%>¥
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderStyle HorizontalAlign=Center />
<ItemStyle HorizontalAlign =Center />
<ItemTemplate >
<asp:LinkButton ID="lnkbtnDelete" runat="server" CommandArgument ='<%#Eval("BookID") %>' OnCommand ="lnkbtnDelete_Command">删除</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>

</Columns>
<FooterStyle BackColor="Tan" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<AlternatingRowStyle BackColor="PaleGoldenrod" />
</asp:GridView>
</td>
</tr>
<tr align =left valign =top >
<td align="center" >
<asp:LinkButton ID="lnkbtnUpdate" runat="server" OnClick="lnkbtnUpdate_Click">更新购物车</asp:LinkButton>
 <asp:LinkButton ID="lnkbtnClear" runat="server" OnClick="lnkbtnClear_Click" >清空购物车</asp:LinkButton>
<asp:LinkButton ID="lnkbtnContinue" runat="server" OnClick="lnkbtnContinue_Click" >继续购物</asp:LinkButton>
<asp:LinkButton ID="lnkbtnCheck" runat="server" OnClick="lnkbtnCheck_Click" >前往服务台</asp:LinkButton>
</td>
</tr>
<tr>
<td align="left" >
<br />
 <li>如果要修改商品数量,请单击“更新购物车”按钮    </li> <li>如果要取消某个商品,请直接单击表格控件中的“删除”
<br />
</li>
</td>
</tr>
</table>
</td>
</tr>
</table>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式