Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. string ID;
  2.  
  3. Label lblID = DataProducto.Items[4].FindControl("lbl_ID") as Label;
  4. ID = lblID.Text;
  5.  
  6. Label lblNombre_prod =
  7. DataProducto.Items[0].FindControl("lblNombre_prod") as Label;
  8. string nombre = lblNombre_prod.Text;
  9.  
  10. Label lbl_preciounit =
  11. DataProducto.Items[3].FindControl("lbl_preciounit") as Label;
  12. double precio = double.Parse(lbl_preciounit.Text);
  13.  
  14. <asp:DataList ID="DataProducto" runat="server" RepeatDirection="Horizontal"
  15. OnItemCommand="DataProducto_ItemCommand">
  16. <ItemTemplate>
  17. <asp:Label ID="lblNombre_prod" runat="server" Text='<%#
  18. Eval("Nombre_prod") %>' Font-Bold="True"></asp:Label>
  19. <br />
  20. <asp:Image ID="img_prod" runat="server" ImageUrl='<%#
  21. Eval("img_Prod") %>' />
  22. <br />
  23. <asp:Label ID="lbl_descprod" runat="server" Text='<%#
  24. Eval("Descrip_prod") %>' Width="200px"></asp:Label>
  25. <br />
  26. <asp:Label ID="lbl_preciounit" runat="server" Text='<%#
  27. Eval("Precio_Unit") %>'></asp:Label>
  28. <br />
  29. <asp:Label ID="lbl_ID" runat="server" Text='<%#
  30. Eval("ID_producto") %>'></asp:Label>
  31. <br />
  32. <asp:Button ID="btnagregar" runat="server" Text="Agregar"
  33. CommandName="addtocart" OnClick="btnagregar_Click"/>
  34.  
  35. </ItemTemplate>
  36. </asp:DataList>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement