473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

ImageMap asp.net control click event

I have the following code

ImageMap image1 = new ImageMap();
image1.Click += new ImageMapEventHandler(ImageMap_Click);
image1.HotSpotMode = HotSpotMode.PostBack;
image1.ImageUrl = "~/images/permacon/page2.png";
if (Percentage != 100.0)
{
image1.Width = Unit.Percentage(Percentage);
image1.Height = Unit.Percentage(Percentage);
}
image1.HotSpots.Add(hs(7,72, 115, 195, 196));
image1.HotSpots.Add(hs(17, 197, 114, 317, 196));
image1.HotSpots.Add(hs(25, 75, 239, 194, 324));
image1.HotSpots.Add(hs(33, 198, 240, 312, 323));
image1.HotSpots.Add(hs(34, 74, 368, 191, 448));
image1.HotSpots.Add(hs(35, 196, 369, 317, 446));
image1.HotSpots.Add(hs(37, 155, 487, 202, 498));
image1.HotSpots.Add(hs(38, 184, 500, 249, 512));
image1.HotSpots.Add(hs(39, 97, 515, 316, 524));
image1.HotSpots.Add(hs(40, 142, 528, 274, 537));
image1.HotSpots.Add(hs(41, 183, 541, 272, 550));
image1.HotSpots.Add(hs(42, 156, 553, 256, 564));
image1.HotSpots.Add(hs(43, 150, 566, 249, 579));
image1.HotSpots.Add(hs(44, 149, 581, 205, 592));
image1.HotSpots.Add(hs(45, 186, 594, 245, 605));
image1.HotSpots.Add(hs(46, 186, 608, 266, 619));
image1.HotSpots.Add(hs(49, 153, 654, 255, 663));
image1.HotSpots.Add(hs(50, 130, 665, 270, 677));
image1.HotSpots.Add(hs(51, 134, 679, 246, 690));
image1.HotSpots.Add(hs(52, 186, 694, 251, 704));
image1.HotSpots.Add(hs(53, 128, 706, 280, 717));
image1.HotSpots.Add(hs(54, 140, 719, 299, 760));
image1.HotSpots.Add(hs(55, 148, 792, 242, 800));
image1.HotSpots.Add(hs(56, 140, 805, 270, 828));
image1.HotSpots.Add(hs(57, 184, 863, 238, 873));
image1.HotSpots.Add(hs(58, 140, 878, 203, 888));
image1.HotSpots.Add(hs(59, 138, 888, 293, 901));
image1.HotSpots.Add(hs(60, 184, 916, 286, 928));
image1.HotSpots.Add(hs(63, 185, 929, 258, 939));
image1.HotSpots.Add(hs(64, 184, 942, 271, 956));
this.pnlPages.Controls.Add(image1);

the method hs is

RectangleHotSpot hs(int Page, int Left, int Top, int Right, int Bottom)
{
RectangleHotSpot hotspot = new RectangleHotSpot();
hotspot.HotSpotMode = HotSpotMode.PostBack;
hotspot.PostBackValue = Page.ToString();
hotspot.Bottom = (int)((double)Bottom * (Percentage / 100.0));
hotspot.Left = (int)((double)Left * (Percentage / 100.0));
hotspot.Right = (int)((double)Right * (Percentage / 100.0));
hotspot.Top = (int)((double)Top * (Percentage / 100.0));
return hotspot;
}

and the ImageMap_Click is

void ImageMap_Click(object sender, ImageMapEventArgs e)
{

CurrentPage = Convert.ToInt32(e.PostBackValue);
ShowPage();
}

When I render this page and click on any of the hotspots, the ImageMap_Click
event is never fired.

Aug 31 '07 #1
0 1398

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: KatB | last post by:
Hi, I'm creating an asp.net application and one of the functions I need is to click on a "Where Is This Office Located?" button. In a table, each employee will have an office code location...
0
by: Gilgamesh | last post by:
Hi, I have some very limited knowledge of web development but I have an imagemap in which I want to be able to display a small yellow circle at certain pre-define locations. When the user moves...
0
by: artich | last post by:
Hi, I'm developing an application for an internet TV browser (Opera for TV) and like MSN TV, the browser interprets an ImageButton that displays a large image as an Image Map because the...
1
by: Mad Scientist Jr | last post by:
I found some info on creating an imagemap in .NET at http://msconline.maconstate.edu/Tutorials/ASPNET2/ASPNET05/aspnet05-04.aspx but in VS.NET I don't see any ImageMap object under...
9
by: Nathan Sokalski | last post by:
I am using ASP.NET 2.0's ImageMap Control to create 2 imagemaps, one directly below the other. When I do this a thin blank space appears between them. After several days of frustration I realized...
2
by: onerobe | last post by:
Hi everyone. I have this bizarre problem and i am hoping someone can point me in the right direction. I have a group of form selects, and when one is changed it dynamically changes the content...
1
by: Jeff | last post by:
ASP.NET 2.0 I've got problems with the Width of the ImageMap below. The problem is that the ImageMap's Width doesn't have any effect in my GridView, the width are determine by width of the...
0
by: Mikael Syska | last post by:
Hi, Is there a way to catch the "onMouseOver" event on the hotspots of an imagemap control? I want to show a tooltip, when the mouse is over, and that seems very hard since I can't add the...
0
by: DamienS | last post by:
Hi, I have a situation where I have custom user controls 'cut out' of the background image of a master page. Basically, I've used photoshop to export a sliced image which is used in the master...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.