Page

How to use ImageMap Control in asp.net

// Default.aspx //

<%@Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server">
    <title>Image Map Example</title>
</head>
<body>
    <form id="form1" runat="server">
 <asp:ImageMap ID="ImageMap1" runat="server"  ImageUrl="~/pic/lo.png" Width="207px" HotSpotMode="PostBack" style="position: absolute;left:1134px;top:68px; height: 50px;">
  <asp:RectangleHotSpot AlternateText="Login" HotSpotMode="Navigate"Left="0" NavigateUrl="~/Login1.aspx" Right="100" Top="0" Bottom="40"/>
   <asp:RectangleHotSpot AlternateText="View Cart" HotSpotMode="Navigate"Left="110" NavigateUrl="~/UserCart.aspx" Right="210" Top="0" Bottom="40"  />                
                                                    
     </asp:ImageMap>  
  </form>
</body>
</html>

// Login1.aspx //

<%@Language="C#" AutoEventWireup="true" CodeFile="Login1.aspx.cs" Inherits="Login1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server">
    <title>Image Map Example</title>
</head>
<body>
    <form id="form1" runat="server">
<div>
<h1> Login Page </h1>
</div>
 </form>
</body>
</html>

// UserCart.aspx //

<%@Language="C#" AutoEventWireup="true" CodeFile="UserCart.aspx.cs" Inherits="UserCart" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server">
    <title>Image Map Example</title>
</head>
<body>
    <form id="form1" runat="server">
<div>
<h1> UserCart Page </h1>
</div>
 </form>
</body>
</html>

OUTPUT


Now, Click On Left Side "Sign in to Your Account" And Click On Right Side "View Cart"

No comments:

Post a Comment