Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

ASP.NET 2.0 Quickstart Tutorials

ImageMap

Use the ImageMap control to create an image that contains defined hotspot regions. When a user clicks a hot spot region, the control can either generate a post back to the server or navigate to a specified URL. For example, you can use this control to display a map of a geographical region. When a user clicks a specific region on the map, the control navigates to a URL that provides additional data about the selected region. You can also use this control to generate a post back to the server and run specific code based on the hot spot region that was clicked. For example, you can use an ImageMap control to capture user responses such as votes. When a user clicks the hot spot region defined for yes votes, code is called to record a yes response in a database. When a user clicks on the hot spot region defined for no votes, a no response is recorded. You can also mix these two scenarios within a single ImageMap control. For example, you can specify one hot spot region to navigate to a URL and another hot spot region to post back to the server.

The following example illustrates navigating to different URLs based on the region of the image that is clicked.

VB ImageMap Navigate URL
Run Sample View Source

The following example illustrates running different server code based on the region of the image that is clicked.

VB ImageMap Run Server Code
Run Sample View Source