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

  • Home
  • SEARCH
  • 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 1048487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:27:50+00:00 2026-05-16T16:27:50+00:00

I have a repeater control and under the ItemTemplate, I have Image control. Anyway

  • 0

I have a repeater control and under the ItemTemplate, I have Image control. Anyway the old

How can I set the ImageUrl programatically?

Anyway, the old html code I have was like this:

<ItemTemplate>
   <img src="<%# Eval("ImageSource") %>" alt="" />
</ItemTemplate>

But I want to check if the image exists in directory or not then I can setup with temp image.

I have a code but .. it’s not really working so there’s no sense of showing it here. Can you guys help me? Should I use ItemCreated or ItemDataBound event?

  • 1 1 Answer
  • 2 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-16T16:27:50+00:00Added an answer on May 16, 2026 at 4:27 pm

    In the xml side in the template, you need to call a method directly.

    <asp:Image runat="server" ID="myImg" ImageUrl='<%# MyImageUrlFunction(Eval("DataFieldName").ToString()); %>' />
    

    You need a corresponding method in the code behind defined publicly:

    public string MyImageUrlFunction(string field) 
    {
        // put some logic here to determine url
        return imageUrl;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a nested repeater control. Here is what the HTML looks like: <ItemTemplate>
I have Repeater Control and in that i have code like this <div runat=server
I have a repeater control with item template like this: <ItemTemplate> <table width=70%> <tr
I have Repeater control like this; <asp:Repeater ID=repeaterCategoryList runat=server onitemcommand=repeaterCategoryList_ItemCommand> <ItemTemplate> <td class=center> <asp:Button
I have a repeater control that contains an ItemTemplate containing a databound label and
I have a Repeater control in my aspx page: <asp:Repeater ID=repeater runat=server EnableViewState=false> <ItemTemplate>
I have a nested Repeater control in the ItemTemplate of another Repeater. I want
I am using the Repeater control. I can have around 300 records maximum. I
I have a nested repeater set up but the child repeater control is not
I have a repeater control outputting some HTML. I want a table which outputs

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.