Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4006836
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:33:42+00:00 2026-05-20T08:33:42+00:00

I am trying to add an image overlay of a cell within a data

  • 0

I am trying to add an image overlay of a cell within a data bound gridview cell in ASP.Net (C#). The effect is designed to have a string within the image that is going to sit on top of the image that is pulled from the server.

IE:

Database contains path to images. Data grid is pulling these images in based on the ID of the items in question. I need to pull the price from the database and lay it onto an image that is placed over the data bound image cell.

SQL Statement gets results.
Results contains path to image for items.
Items are sometimes on sale, so a special overlay is needed.
Overlay will have a varying price overlaying it.

I tried to break it down into easy portions. I am not sure if I am over thinking things or not but I can’t find a feasible way to do this. The data is converted to a table due to the data grid control in ASP.Net, and there isn’t any way to determine the IDs after the table is created.

If anyone has any ideas I would be most appreciative.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:33:43+00:00Added an answer on May 20, 2026 at 8:33 am

    One way to do this is to set the cell’s background to the image using CSS and write the price as plain text into the same cell (rendered output displayed):

    <td class="product"  
        style="background: url(path-to-image.png) top left no-repeat">  
        <span class="price">$ 3.22</span>  
    </td>  
    

    The only downside to this approach is that the cell would have to be explicitly sized to the same dimensions as the image, which you may not know.

    Another option is to use an <img> element inside the cell and still use a <span> for the plain text price (rendered output displayed):

    <td class="product">
        <img src="path-to-image.png" alt="..."/>
        <span class="price">$ 3.22</span>
    </td>
    

    Regardless of which method, you would use CSS to position and style the price within the cell:

    td.product { 
        position: relative
    }
    span.price {  
        position: absolute;
        top : 40px;    < whatever works for you
        left: 40px;    <  
    }
    

    A very simple GridView example with templating

    You will need to set the GridView’s AutoGenerateColumns property to false and handle the column creation and templating yourself.

    <asp:GridView ID="products" runat="server"  
                  AutoGenerateColumns="false"  
                  DataKeyNames="productId"  
                  DataSourceID="ObjectDataSource1">
        <Columns>
            <asp:BoundField DataField="productId" HeaderText="Product ID" />
            <asp:TemplateField HeaderText="Whatever ...">
                <ItemTemplate>
                    <img src='<%# DataBinder.Eval(Container.DataItem,"productImageUrl") %>'
                         alt="..." />
                    <span class="price">
                        <%# DataBinder.Eval(Container.DataItem,"productPrice","{0:c}") %>
                    </span>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="productDesc" HeaderText="Description" />
        </Columns>
    </asp:GridView>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add an arrow image to my link and have it positioned
I have created a custom server control and trying to add an image using
I have made my own drop down here: http://jsfiddle.net/Hunter4854/GJVjT/ I am trying to add
I am trying to add an image into a document using WordML. I have
I am Trying to add an image to an existing button..I have done that
Hi I'm trying to add my image name to my database, I have a
I'm trying to add image and file upload to my CKEditor instance (within a
I am trying to add and image and then put some text(title) on the
I'm trying to add an image to a generated html word document that is
I'm trying to add an image to a report. The image src url is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.