Hello.
I have designed a shopping cart as mentioned in one of the wrox books..The cart is designed as a user control and then it is used elsewhere...What i want is instead of the Edit & Delete links i want to use Images..The problem is also that i use themes..so each theme should use different images..so, here i am stucked!
Here is my complete control design:
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ShoppingCart.ascx.cs" Inherits="ShoppingCart" %>
<h1>Your Shopping Cart</h1>
<asp:GridView SkinID="gvCart" ID="CartGrid" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductId" OnRowCancelingEdit="CartGrid_RowCancelingEdit" OnRowDeleting="CartGrid_RowDeleting" OnRowEditing="CartGrid_RowEditing" OnRowUpdating="CartGrid_RowUpdating">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="Image1" Height="100" Width="100" runat="server" ImageUrl='<%# Eval ("ProductImageUrl","~/assets/{0}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ProductName" HeaderText="Product" ReadOnly="True" />
<asp:BoundField DataField="qty" HeaderText="Qty" />
<asp:BoundField DataField="Price" DataFormatString="{0:c}" HeaderText="Price" ReadOnly="True" />
<asp:BoundField DataField="LineTotal" DataFormatString="{0:c}" HeaderText="Total"
ReadOnly="True" />
<asp:CommandField ShowEditButton="True" ShowDeleteButton="True" ButtonType="Image" />
</Columns>
<EmptyDataTemplate>
There is nothing in your shopping cart.
</EmptyDataTemplate>
</asp:GridView>
<br />
<asp:Label ID="TotalLabel" runat="server" Font-Bold="True"></asp:Label>
How do i make this code to read the images according to the selected theme..All folder names are the standard..eg../app_theme/MyThemeName/Images/...