473,545 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImageMap asp.net control click event

I have the following code

ImageMap image1 = new ImageMap();
image1.Click += new ImageMapEventHa ndler(ImageMap_ Click);
image1.HotSpotM ode = HotSpotMode.Pos tBack;
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.C ontrols.Add(ima ge1);

the method hs is

RectangleHotSpo t hs(int Page, int Left, int Top, int Right, int Bottom)
{
RectangleHotSpo t hotspot = new RectangleHotSpo t();
hotspot.HotSpot Mode = HotSpotMode.Pos tBack;
hotspot.PostBac kValue = Page.ToString() ;
hotspot.Bottom = (int)((double)B ottom * (Percentage / 100.0));
hotspot.Left = (int)((double)L eft * (Percentage / 100.0));
hotspot.Right = (int)((double)R ight * (Percentage / 100.0));
hotspot.Top = (int)((double)T op * (Percentage / 100.0));
return hotspot;
}

and the ImageMap_Click is

void ImageMap_Click( object sender, ImageMapEventAr gs e)
{

CurrentPage = Convert.ToInt32 (e.PostBackValu e);
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 1411

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

Similar topics

4
1691
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 entered. I then need to have the office layout image load and have the name of that person highlighted such as bold/red (in the correct office...
0
1559
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 over these circles, I need to show a small pop-up with info regarding this label. Here is my Page_Load method: // These create the hotspots at...
0
1090
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 ImageButton is actually rendered as HTML Input Type=Image. This becomes a problem for the browser's user because the user has to click the ImageButton twice....
1
1403
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 System.Web.UI.WebControls or any ImageMap control on the Web Forms toolbox (just Image and Image Button). If I try pasting code such as below, .NET does not...
9
2106
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 that the difference between what the ImageMap Control outputs and the html on the page I was trying to reproduce with ASP.NET 2.0 was the following:...
2
2129
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 of the next. fairly bog standard. no problems there. I also have an image map. You click on part of the image and it calls a javascript function...
1
1997
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 column and the with of the div (the div the ImageMap is included in). In the code below the column & div has Width of 300px and ImageMap has Width of...
0
885
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 javascript. Are there any way this can be done ? I have searched google for the past few hours ... with no results, that could be used.
0
1452
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 page. I take a slice (from the middle) and use that as the background of a user control using the asp:panel control's backgroundURL property. ...
0
7479
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7411
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7439
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5987
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4962
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3468
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1901
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.