asp:ImageMap control
Image map control is used to create an image that includes a clickable hotspot area.
Image map control is used to create an image that includes a clickable hotspot area. When a user clicks on this area, the user is either sent the URL or is called a sub-program. When it is provided on the page, it is implemented through the <img /> HTML tag.
Its properties like backcroll, foreclosure, border collar, border style, borderwidth, height etc.
Following are some important properties that are very useful.
ImageUrl | Url of image location. |
AlternetText | Appears if image not loaded properly |
Tooltip | Appears when on mouse over the image |
ImageAlign | Used to align the Text beside image. |
HotSpotMode | Postback / Navigate .... While navigating, the user is navigated to a different URL. In the case of postback, the page is posted back to the server. |
OnClick | Attach a server side event that fires after clicking on image when HostSpotMode is PostBack. |
PostBackValue | You can access it through ImageMapEventArgs in the server side click event. (Eg E. Postback Value) |
<asp:ImageMap ID="ImageMap1" runat="Server" ImageUrl="controldata/gotocontrols.gif" OnClick="FireImageMapClick">
<asp:RectangleHotSpot AlternateText="Label" Left="10" Top="33" Right="75" Bottom="10" NavigateUrl="~/tutorials/controls/label.aspx" />
<asp:RectangleHotSpot AlternateText="Button" Left="80" Top="33" Right="150" Bottom="10" NavigateUrl="~/tutorials/controls/button.aspx" />
<asp:RectangleHotSpot AlternateText="ImageButton" Left="155" Top="33" Right="275" Bottom="10" NavigateUrl="~/tutorials/controls/imagebutton.aspx" />
<asp:RectangleHotSpot AlternateText="Fires server side Click Event. Postback value is ListBox" Left="300" Top="40" Right="400" Bottom="0" NavigateUrl="~/tutorials/controls/listbox.aspx" HotSpotMode="PostBack" PostBackValue="ListBox" />
</asp:ImageMap>
0 comments:
Post a Comment