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 8059187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:35:30+00:00 2026-06-05T09:35:30+00:00

I’m using a Datalist to populate a vehicle with its images as thumbnails. When

  • 0

I’m using a Datalist to populate a vehicle with its images as thumbnails.
When a user clicks on a small image, the onclick event needs to recall the image from the database and load it into an above bigger Image control.
I’m using an ImageHandler.ashx, to retrieve the image binary from SQL and renders it in the image control.

Everything works perfect in Chrome and IE7, but not working in IE9.
If I click on the small image in IE9, its like the image handler never executes, the bigger image never gets loaded with the selected image. When viewing page source in IE9, the code looks as follows:

IE9 Page source:

<table id="table1" style="padding-left: 0px; padding-top: 0px; width: 108px; height: 73px;
        background-image: url('Images/smallimageframe.png'); background-repeat: no-repeat;
        background-color: #FFFFFF;">
        <tr>
            <td align="center">
                <img id="DataListVehicles_ctl00_imgVehicle" class="imgOpacity" onerror="this.src='Images/no_image.jpg'" onclick="imgBig.src='ImageHandler.ashx?ID=29';" src="ImageHandler.ashx?ID=29" alt="29" style="border-style:None;height:55px;width:90px;border-width:0px;" />
            </td>
        </tr>
    </table>
</td><td class="DataList">
    <table id="table1" style="padding-left: 0px; padding-top: 0px; width: 108px; height: 73px;
        background-image: url('Images/smallimageframe.png'); background-repeat: no-repeat;
        background-color: #FFFFFF;">
        <tr>
            <td align="center">
                <img id="DataListVehicles_ctl01_imgVehicle" class="imgOpacity" onerror="this.src='Images/no_image.jpg'" onclick="imgBig.src='ImageHandler.ashx?ID=30';" src="ImageHandler.ashx?ID=30" alt="30" style="border-style:None;height:55px;width:90px;border-width:0px;" />
            </td>
        </tr>
    </table>
</td><td class="DataList">
    <table id="table1" style="padding-left: 0px; padding-top: 0px; width: 108px; height: 73px;
        background-image: url('Images/smallimageframe.png'); background-repeat: no-repeat;
        background-color: #FFFFFF;">
        <tr>
            <td align="center">
                <img id="DataListVehicles_ctl02_imgVehicle" class="imgOpacity" onerror="this.src='Images/no_image.jpg'" onclick="imgBig.src='ImageHandler.ashx?ID=31';" src="ImageHandler.ashx?ID=31" alt="31" style="border-style:None;height:55px;width:90px;border-width:0px;" />
            </td>
        </tr>
</table>

Server side:

    protected void DataListVehicles_ItemDataBound(object sender, DataListItemEventArgs e)
    {
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Image imgVehicle = e.Item.FindControl("imgVehicle") as Image;               
            imgVehicle.ImageUrl = "ImageHandler.ashx?ID=" + m_Vehicles.ListingPhotos[e.Item.ItemIndex].ID;

            imgVehicle.Attributes.Add("onclick", "imgBig.src='ImageHandler.ashx?ID=" + m_Vehicles.ListingPhotos[e.Item.ItemIndex].ID + "';"); 
        }
    }

Markup:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <link href="css/asp.css" rel="stylesheet" type="text/css" />

    <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function() {
            $('.imgOpacity').each(function() {
                $(this).hover(
                    function() {
                        $(this).stop().animate({ opacity: 1.0 }, 500);
                    },
                   function() {
                       $(this).stop().animate({ opacity: 0.6 }, 500);
                   })
            });
        });
    </script>

    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 780px" class="OtherControl">
            <tr>
                <td style="padding-left: 8px; padding-top: 3px;">
                    <asp:Label ID="lblDescription" runat="server" Font-Bold="True" ForeColor="#FF9900"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <table style="width: 100%">
                        <tr>
                            <td align="center">
                                <table style="padding-left: 0px; padding-top: 0px; width: 320px; height: 220px; background-image: url('Images/imageframe.png');
                                    background-repeat: no-repeat; background-color: #FFFFFF;">
                                    <tr>
                                        <td align="center">
                                            <asp:Image ID="imgBig" runat="server" Height="200px" Width="300px" onerror="this.src='Images/no_image.jpg'"/>
                                        </td>
                                    </tr>
                                </table>
                                <asp:DataList ID="DataListVehicles" runat="server" RepeatDirection="Horizontal" RepeatColumns="4"
                                    ShowFooter="False" ShowHeader="False" BorderStyle="None" OnItemDataBound="DataListVehicles_ItemDataBound"
                                    HorizontalAlign="Center">
                                    <ItemStyle CssClass="DataList" />
                                    <ItemTemplate>
                                        <table id="table1" style="padding-left: 0px; padding-top: 0px; width: 108px; height: 73px;
                                            background-image: url('Images/smallimageframe.png'); background-repeat: no-repeat;">
                                            <tr>
                                                <td align="center">
                                                    <asp:Image ID="imgVehicle" runat="server" CssClass="imgOpacity" Width="90px" Height="55px"
                                                        onerror="this.src='Images/no_image.jpg'" BorderStyle="None" />
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                </asp:DataList>
                            </td>
                        </tr>            
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>  

Hope someone can help.
Thanks

  • 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-06-05T09:35:31+00:00Added an answer on June 5, 2026 at 9:35 am

    It could be the way you are referring to “imgBig” from the onClick JavaScript, you could try using document.getElementById(‘imgBig’).src=’…. instead. Also have you opened the IE developer tools window and checked for JavaScript errors when you click the image?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.