点击链接按钮,它显示标签,首先选择此项 [英] click on link button and it's display lable that select this first

查看:85
本文介绍了点击链接按钮,它显示标签,首先选择此项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



当用户想要在购物车中添加产品并点击添加到购物车链接按钮时,它首先显示选择尺寸以便我可以做什么它是


我的代码加入购物车:



hello

When user want to add product in cart and click on add to cart link button than it''s display select size first so how i can do it

my code for add to cart:

<asp:LinkButton ID="linkAddtocart" runat="server"  oncommand="BuyNow_Command"

               CommandArgument='<%#Eval("Product_ID") %>'>Add To Cart</asp:LinkButton>







protected void BuyNow_Command(object sender, CommandEventArgs e)
   {

       string str = "";
       if (Session["ProductID"] == null)
       {
           str = e.CommandArgument.ToString();
           Session["ProductID"] = str + "|";
       }
       else
       {
           str = Session["ProductID"].ToString();
           str = str + e.CommandArgument.ToString() + "|";
           Session["ProductID"] = str;
       }

       Label1.Text = str;

   }



和lable以及它的尺寸值:




and lable and it''s value of sizes:

<asp:Label
               ID="lblSize"
               runat="server"
               Text="Select Size :"></asp:Label>

               <asp:RadioButton ID="RadioButton1" GroupName="Size" runat="server" Text="Small"
               oncheckedchanged="RadioButton1_CheckedChanged" />
               <asp:RadioButton ID="RadioButton2" GroupName="Size" runat="server"
               Text="Medium" oncheckedchanged="RadioButton2_CheckedChanged" />
               <asp:RadioButton ID="RadioButton3" GroupName="Size" runat="server"
                Text="Large" oncheckedchanged="RadioButton3_CheckedChanged" />
               <asp:RadioButton ID="RadioButton4" GroupName="Size" runat="server"
                Text="XL" oncheckedchanged="RadioButton4_CheckedChanged" />
               <asp:RadioButton ID="RadioButton5" GroupName="Size" runat="server"
                Text="XXL" oncheckedchanged="RadioButton5_CheckedChanged" />
               <asp:RadioButton ID="RadioButton6" GroupName="Size" runat="server"
                Text="XS" oncheckedchanged="RadioButton6_CheckedChanged" />

推荐答案

试试这个: - 简单购物车(篮子)用户控件使用ASP.NET& JavaScript(浮动,可移动和可调整大小) [ ^ ]
Try this one : - Simple Shopping Cart (Basket ) User Control using ASP.NET & JavaScript (Floating, Movable and Resizable)[^]


这篇关于点击链接按钮,它显示标签,首先选择此项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆