onmouseover client-side event for RectangleHotSpot

Discussion in 'ASP .Net Web Controls' started by Chris Chamberlain, Aug 30, 2007.

  1. Hi,

    I'm currently generating client-side imagemaps using PlaceHolders and
    HtmlGenericControls. This allows me to add attributes for onmouseover and
    onmouseout events onto the <area> hotspots themselves, eg:

    <map name="mapNav">
    <area shape="RECT" coords="0,0,119,14" alt="information about buying a
    property in france" href="file1.aspx" onmouseover="mapOver(1,true)"
    onmouseout="mapOver(1,false);"></area>
    <area shape="RECT" coords="0,14,119,28" alt="information about regions
    in france and the partner offices" href="file2.aspx"
    onmouseover="mapOver(2,true)" onmouseout="mapOver(2,false);"></area>
    <area shape="RECT" coords="119,0,238,14" alt="property for sale in
    france" href="file3.aspx" onmouseover="mapOver(3,true)"
    onmouseout="mapOver(3,false);"></area>
    </map>

    I have just discovered the asp:ImageMap webcontrol and the associated
    RectangleHotSpot and am trying to reproduce the above using these controls.

    However, the RectangleHotSpot control will not allow me to add attributes to
    itself, hence I am unable to add individual onmouseover and onmouseout
    events for each of the hotspots.

    Does anyone have a way around this? Am I missing something obvious?

    Kind regards

    Chris Chamberlain
    Head of IT
    VEF (UK) Ltd
    Ground Floor City Reach
    5 Greenwich View Place
    Millharbour
    London E14 9NN

    Tel: (00 44) (0)20 7515 8660
    Fax: (00 44) (0)20 7515 5070
    URL: www.vefuk.com
    Chris Chamberlain, Aug 30, 2007
    #1
    1. Advertising

  2. Chris Chamberlain

    James Page Guest

    Try this:

    <asp:ImageButton
    id="ImageButton1"
    ImageUrl="button1.gifâ€

    onmouseover="this.src='~/URL OF MOUSE OVER IMAGE'"
    onmouseout="this.src='~/URL OF MOUSE OUT IMAGE'"

    OTHER PROPERTIES HERE

    runat="server">

    </asp:ImageButton>

    In VS2005 the code section: "onmouseover /onmouseout" may be highlighted as
    wrong but it will work just fine in IE and Firefox.

    The full MSDN article is here:

    http://msdn2.microsoft.com/en-us/library/Aa479011.aspx#aspnet-usingjavascript_topic03

    Hope this helps

    James Page
    James Page, Sep 18, 2007
    #2
    1. Advertising

  3. Chris Chamberlain

    Gregor Guest

    Hi
    I'm having the same problem and I don't think that ImageButton would solve the problem. Map area means that image would have many buttons . In my case over 1000.

    I'm currently working on a workarround class, such as:
    http://www.codeproject.com/useritems/HtmlMap.asp

    It seems that MS is trying to hide JavaScript and html possibilityes...
    Gregor, Sep 19, 2007
    #3
  4. Chris Chamberlain

    Gregor Guest

    Hi
    I'm having the same problem and I don't think that ImageButton would solve the problem. Map area means that image would have many buttons . In my case over 1000.

    I'm currently working on a workarround class, such as:
    http://www.codeproject.com/useritems/HtmlMap.asp

    It seems that MS is trying to hide JavaScript and html possibilityes...
    Gregor, Sep 19, 2007
    #4
  5. Chris Chamberlain

    Gregor Guest

    Hi
    I'm having the same problem and I don't think that ImageButton would solve the problem. Map area means that image would have many buttons . In my case over 1000.

    I'm currently working on a work arround class, such as:
    http://www.codeproject.com/useritems/HtmlMap.asp

    It seems that MS is trying to hide JavaScript and html possibilityes...
    Gregor, Sep 19, 2007
    #5
  6. Chris Chamberlain

    Gregor Guest

    Hi
    I'm having the same problem and I don't think that ImageButton would solve the problem. Map area means that image would have many buttons . In my case over 1000.

    I'm currently working on a work around class, such as:
    http://www.codeproject.com/useritems/HtmlMap.asp

    It seems that MS is trying to hide JavaScript and html possibilityes...
    Gregor, Sep 19, 2007
    #6
  7. Chris Chamberlain

    Gregor Guest

    Hi
    I'm having the same problem and I don't think that "ImageButton" would solve the problem. Map area means that image would have many buttons . In my case over 1000.

    I'm currently working on a work around class, such as:
    http://www.codeproject.com/useritems/HtmlMap.asp

    It seems that MS is trying to hide JavaScript and html possibilityes...
    Gregor, Sep 19, 2007
    #7
  8. Chris Chamberlain

    Gregor Guest

    Hi
    I'm having the same problem and I don't think that "ImageButton" would solve the problem. Map area means that image would have many buttons . In my case over 1000.

    I'm currently working on a work around class, such as:
    http://www.codeproject.com/useritems/HtmlMap.asp

    It seems that MS is trying to hide JavaScript and html possibilityes...

    What a... is:
    '<'script runat="server"'>'
    Gregor, Sep 19, 2007
    #8
  9. Chris Chamberlain

    Gregor Guest

    Hi
    I'm having the same problem and I don't think that "ImageButton" would solve the problem. Map area means that image would have many buttons . In my case over 1000.

    I'm currently working on a work around class, such as:
    http://www.codeproject.com/useritems/HtmlMap.asp

    It seems that MS is trying to hide JavaScript and html possibilityes...

    What a... is:
    '<'script runat="server"'>'
    Gregor, Sep 19, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=
    Replies:
    2
    Views:
    6,468
    rick74
    May 27, 2008
  2. Boss302
    Replies:
    0
    Views:
    1,023
    Boss302
    Nov 21, 2006
  3. Bogdan
    Replies:
    2
    Views:
    639
    Bogdan
    Jun 9, 2008
  4. Zoe Hart
    Replies:
    1
    Views:
    354
    Scott Wisniewski
    Jan 8, 2004
  5. Guest

    Fire server side event before client side event

    Guest, Mar 17, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    576
    Ken Cox [Microsoft MVP]
    Mar 18, 2005
Loading...

Share This Page