Image Map not working in IE7

Last post 07-04-2009 2:43 AM by mijaved. 5 replies.

Sort Posts:

  • Image Map not working in IE7

    08-07-2008, 12:40 AM
    • Member
      1 point Member
    • the.one
    • Member since 01-04-2008, 11:16 PM
    • Posts 7

     I have a fairly simple image map that I'm using in a web page.  It works in Firefox, but not in IE7.  Here is the code:

     <div id="logo">
            <asp:ImageMap ID="Menu_Links" runat="server" HotSpotMode="Navigate" Height="330px" Width="850px" ImageUrl="~/images/header_blank.gif">
                <asp:RectangleHotSpot AlternateText="Home" HotSpotMode="Navigate" Bottom="330" Left="50" NavigateUrl="main.aspx?option=home" Right="350" Top="80" />
                <asp:RectangleHotSpot AlternateText="Our Menu" HotSpotMode="Navigate" Bottom="165" Left="380" NavigateUrl="main.aspx?option=menu" Right="435" Top="140" />
                <asp:RectangleHotSpot AlternateText="About Us" HotSpotMode="Navigate" Bottom="165" Left="450" NavigateUrl="about.aspx" Right="525" Top="140" />
                <asp:RectangleHotSpot AlternateText="Find Us" HotSpotMode="Navigate" Bottom="165" Left="540" NavigateUrl="main.aspx" Right="630" Top="140" />
                <asp:RectangleHotSpot AlternateText="Contact Us" HotSpotMode="Navigate" Bottom="165" Left="650" NavigateUrl="contact.aspx" Right="735" Top="140" />
            </asp:ImageMap>
        </div>

     

    The site that this is running on is www.coconutkennys.com if you want to have a look see.  I've tried inserting "Name="Menu_Links" " into the <asp:ImageMap section and I got the same results.  Can anyone help me with this?
     

    www.dazzleblab.com | www.noahwass.com
    Filed under:
  • Re: Image Map not working in IE7

    08-07-2008, 8:11 AM
    • Contributor
      2,247 point Contributor
    • ShailAtlas
    • Member since 07-18-2006, 5:07 PM
    • Norway
    • Posts 546

    Hello,
    Make a static HTML page with that image map as static. I mean to say that just make a sample HTML Page which has your ImageMap and then run that in FF and IE 7. Now if you see that its working in both the places, next step you should check the markup of your static imagemap HTML and the one generated by the ASP image map in IE 7. Something like step by step debugging.
    Thank You,
    Shail

  • Re: Image Map not working in IE7

    08-08-2008, 12:10 AM
    • Member
      1 point Member
    • the.one
    • Member since 01-04-2008, 11:16 PM
    • Posts 7

    Shail -

     Did what you said (good tip by the way) and narrowed it down to the DOCTYPE line.  As soon as I took that line away, IE allowed me to click on the image map.   Without the DOCTYPE being defined, the page doesn't load correctly (obviously) and there aren't many choices to choose from for DOCTYPES.  I tried changing the page from the current

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    to the Transitional DOCTYPE and that didn't help anything.  It seems to me like I've seen a workaround for this in javascript.  Do you know a way around this DOCTYPE issue?


    www.dazzleblab.com | www.noahwass.com
  • Re: Image Map not working in IE7

    08-08-2008, 3:39 AM
    • Contributor
      2,247 point Contributor
    • ShailAtlas
    • Member since 07-18-2006, 5:07 PM
    • Norway
    • Posts 546

    Hello,
    I am using this one and I also have an ImageMap. That is working fine in IE 6,7 and FF 2 and 3. Just see what are two lines in my page -

     

    1    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2    <html xmlns="http://www.w3.org/1999/xhtml">
    
     
    Thank You,
    Shail

  • Re: Image Map not working in IE7

    08-08-2008, 10:09 AM
    • Member
      1 point Member
    • the.one
    • Member since 01-04-2008, 11:16 PM
    • Posts 7

     I am using the same lines in my code as well.  Here are the lines verbatim as they appear before my image map:

    <?xml version="1.0" encoding="iso-8859-1"?>
    <!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>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Coconut Kenny's</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link id="LinkCSS" href="default.css" rel="stylesheet" type="text/css" runat="server" />

    </head>
    <body>
    <div id="page">
        <div id="logo">
            <asp:ImageMap ID="Menu_Links" runat="server" HotSpotMode="Navigate" ImageUrl="images/header_blank.gif">

    After this, I have 5 navigational hot spots in the image.  The odd thing for me is that I have an image map a bit further down the page that posts back to the server instead of navigating.  This image map works perfectly fine.

    www.dazzleblab.com | www.noahwass.com
  • Re: Image Map not working in IE7

    07-04-2009, 2:43 AM
    • Member
      2 point Member
    • mijaved
    • Member since 07-19-2008, 1:58 AM
    • Posts 1
    • Important Note:

    Never ever use Server.MapPath to feed your url to ImageUrl property when you are dynamically switching to different Images from backend (cs/vb file).

    [Avoid Frown => eg: ImageMap1.ImageUrl = Server.MapPath("~/Images/*.jpg" )]

    Just user simple file url like we use in aspx.

    [Use Laughing=> eg: ImageMap1.ImageUrl = "../Images/*.jpg"

    However this may not be relevant with this question.



    Mi
    Filed under: ,
Page 1 of 1 (6 items)