-
online Basket Question
Hi All,
first off thanks for your help
i have an online basket asp application which on each category form has a asp:repeater control, i have added in a nother column to each row of the repaeater with an add and clear button, however i dont know how to match up the button or should i say make the button know which row it is on and how to get the code behind the button to work, could anyone give me any idea on where to start,
have a vague idea that it has somthing to do with the
ByVal e As System.EventArgs declaration on the aspr3eapeter behind the page method
any help is always appreciated
Thanks
Rob
-
i have managed to get the row number by using the repeater.items.count properties, and it displays the row number in a hidden text box in each row, but am having issues getting the button to know which row it must be communicating with
is there anyway i can get dynamic buttons to appear per row created so the button knows which row it is going to be editing .?
thanks
Rob
-
thanks in advance
below is the code i used
<form id ="Form1" runat ="server">
<ASP:Repeater id="MyRepeater" runat="server">
<HeaderTemplate>
<Table width="70%" style="font: 8pt verdana">
<tr style="background-color:FF80FF">
<th>
Product Image
</th>
<th>
Item Code
</th>
<th>
Product Name
</th>
<th>
Description
</th>
<th>
Price Each
</th>
<th>
Price/100g
</th>
<th>
Quantity
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:FFC0FF">
<td>
<div align ="center"><img src='<%# Container.DataItem("Location") %>'></div>
</td>
<td>
<asp:Label ID = "Label1" text ='<%#DataBinder.Eval(Container.DataItem, "SKU")%>' runat = "server"></asp:Label>
</td>
<td>
<asp:Label ID = "Label3" text ='<%#DataBinder.Eval(Container.DataItem, "Name")%>' runat = "server"></asp:Label>
</td>
<td>
<%#DataBinder.Eval(Container.DataItem, "Description")%>
</td>
<td>
£<%#DataBinder.Eval(Container.DataItem, "SalePrice")%>
</td>
<td>
£<%#DataBinder.Eval(Container.DataItem, "SalePricePer100G")%>
</td>
<td>
<asp:textbox ID = "Textbox1" runat="Server" size ="4"></asp:textbox> <asp:Button ID = "btnAdd" Text = "Add" runat ="server" /><asp:Button ID = "Button1" Text = "Clear" runat ="server" /><br />
<input type ="checkbox" id ="perG" value = "100g Order" />Per 100g Order
<asp:Textbox id = "Textbox2" text ='<%#MyRepeater.Items.Count%>' runat ="server"></asp:textbox>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</ASP:Repeater>
so i got a button to appear with each row that is created, but i have no idea how to apply the code on the button on each row to know which row it is reflecting
Thanks
Rob
Similar Threads
-
By JDHalfrack in forum .NET
Replies: 4
Last Post: 08-07-2008, 04:17 PM
-
Replies: 0
Last Post: 02-21-2003, 12:43 AM
-
Replies: 0
Last Post: 11-26-2001, 01:51 PM
-
By philys in forum ASP.NET
Replies: 0
Last Post: 09-04-2000, 07:16 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|