Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 18th, 2006, 04:17 AM
Registered User
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to reference a pic from app_themes to control

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:
<%@ 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">
                <asp:Image ID="Image1" Height="100" Width="100" runat="server" ImageUrl='<%# Eval ("ProductImageUrl","~/assets/{0}") %>' />
        <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"  />
        There is nothing in your shopping cart.
<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/...

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wizard Control Reference Colonel Angus .NET Framework 2.0 0 April 28th, 2008 08:54 AM
How do I reference a txtbox control with variable TomW Excel VBA 5 November 28th, 2006 08:57 PM
Reference Page Control from Custom Class wirerider ASP.NET 2.0 Professional 6 February 1st, 2006 07:45 PM
Bad Navigator Control reference horacio_tg BOOK: ASP.NET Website Programming Problem-Design-Solution 0 October 24th, 2003 10:46 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.