Asp.net Image Map control



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.
ImageUrlUrl of image location.
AlternetTextAppears if image not loaded properly
TooltipAppears when on mouse over the image
ImageAlignUsed to align the Text beside image.
HotSpotModePostback / Navigate .... While navigating, the user is navigated to a different URL. In the case of postback, the page is posted back to the server.
OnClickAttach a server side event that fires after clicking on image when HostSpotMode is PostBack.
PostBackValueYou 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>
                 

Share on Google Plus

About It E Research

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment