How to total count Item in this way

Posted by Shail under ASP.NET on 6/18/2014 | Points: 10 | Views : 1506 | Status : [Member] | Replies : 1
i have data list my aspx page

<asp:DataList ID="dldetp" runat="server" Width="100%"
<asp:HiddenField ID="hid1" runat="server" Value='<%#Eval("P_Id") %>' />
<div class="details-left">
<div class="details-left-slider">
<ul id="etalage">
<a href="#">
<asp:Image ID="img1" runat="server" class="etalage_thumb_image" src='<%# "./Admin/P_T1Image/"+Eval("P_T1Image") %>' />
<img class="etalage_source_image" src='<%# "./Admin/P_L1Image/"+Eval("P_L1LargeImage") %>' />
<img class="etalage_thumb_image" src='<%# "./Admin/P_T2Image/"+Eval("P_T2Image") %>' />
<img class="etalage_source_image" src='<%# "./Admin/P_L2Image/"+Eval("P_L2LargeImage") %>' />
<div class="details-left-info">
<div class="details-right-head">
<h1><asp:Label ID="pname" runat="server" Text='<%#Eval("P_Name") %>'></asp:Label></h1>
<ul class="pro-rate">
<li><a class="product-rate" href="#"> <label> </label></a> <span> </span></li>
<li><a href="#">0 Review(s) Add Review</a></li>
<p class="product-detail-info"><%#Eval("P_Desc")%>. </p>
<a class="learn-more" href="#"><h3>MORE DETAILS</h3></a>
<div class="product-more-details">
<ul class="price-avl">
<li class="price"><span>INR<%#Eval("P_MPrice")%></span><label>INR <asp:Label ID="lblprice" runat="server" Text='<%#Eval("P_Price") %>'></asp:Label></label></li>
<li class="stock"><i>In stock</i></li>
<div class="clear"> </div>
<asp:Button ID="btnModalPopup" runat="server" CommandName="AddCart" Text="Add Cart" Style="background-color: Maroon; color: White;" />
<div class="clear"> </div>

and my cs code...........

protected void dldetp_ItemCommand(object source, DataListCommandEventArgs e)
if (e.CommandName == "AddCart")
if (Session["EMail"] == null)
bal.Action = "SelectProductshow";
bal.P_Id = Convert.ToInt32(Request.QueryString["id"]);
DataTable dt = new DataTable();
dt = bal.BalBind();
if (dt.Rows.Count > 0)
bal.Action = "insertcat"


Posted by: Saranpselvam on: 6/25/2014 [Member] Starter | Points: 25

HI please post some more details.

Shail, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response