onmouseover client-side event for RectangleHotSpot

C

Chris Chamberlain

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
 
J

James Page

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
 
G

Gregor

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...
 
G

Gregor

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...
 
G

Gregor

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...
 
G

Gregor

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...
 
G

Gregor

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...
 
G

Gregor

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"'>'
 
G

Gregor

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"'>'
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top