Aniruddh Kewat

Aniruddh Kewat

  • NA
  • 30
  • 19.8k

how can i delete item from datalist using webservice ?

Jul 4 2015 9:44 PM

this is my datalist....i want the item to get deleted when the buttonbtnremovefromcart is clicked.....

thank's in advance......

<asp:DataList ID="dlmycart" runat="server" RepeatLayout="Table" RepeatColumns="1" RepeatDirection="Horizontal" 
CellPadding="0" CellSpacing="0" BackColor="Aqua" Width="100%"> <ItemStyle Width="80%" BackColor="Violet" />
 <ItemTemplate> 
<table border="0" style="width: 100%; height: 300px; border: 2px solid Blue; background-color: ; text-align: center"> 
<tr> 
<td> <b><u><span class="name1"> <%# Eval("Name") %></span></u></b> </td> 
</tr>
 <tr>
 <td> <b>Productid: </b>
   <span class="productId1" style="font-size: 20px; color: Yellow; font-weight: 500;"> <%# Eval("Productid") %></span><br /> 
   <b>Description </b>
   <span class="description1"> <%# Eval("Description") %></span><br /> 
   <b>ImageUrl: </b>
   <span class="imageUrl1"> <%# Eval("ImageUrl")%></span><br /> 
   <img class="image1" alt='' src="Images/<%# Eval("ImageUrl")%>" width="160px" height="320px" /><br /> 
   <b>Price: </b>
   <span class="price1"> <%# Eval("Price")%></span> 
   <img alt="" src="star-icon.png" /> 
   <b>Quantity: </b>
   <span class="quantity1"> <%# Eval("Quantity")%></span><br />   
   <input id="btnremovefromcart" class="btnremovefromcart" type="button" value="Remove From Cart" data-pid='<%#Eval("ProductId") %>' 
   onclick='Removefromcart(this.getAttribute("data-pid"));' /> 
 </td> 
</tr> 
</table> 
</ItemTemplate> 
</asp:DataList>