<span class="Hint">Right-click anywhere on the page to activate the context menu. </span> <cyberakt:ASPnetMenu id="Menu1" MenuStyle="ClassicVertical" MenuData="menuData.xml" ExpandDelay="50" IsContextMenu="true" runat="server" /> <br><br><br><br><br> <h3>Simple Context Menu</h3> <ul> <li>Context menus are created by simply setting the <b>IsContextMenu</b> property to <b>true</b>;</li> <li>Notice how the menu automatically adjusts to window boundaries; </li> </ul> <br><font size="1"> All source code files for this example are located in the following folder: <br> <b>wwwroot/ASPnetMenu/Programming/CSharp/simpleContextMenu/</b> </font> <br><br><br><br> <a href="../../../default.aspx"><img src="../../../design/images/back.gif" border="0">Main Page</a> <br><br><br>
<%@ Register TagPrefix="cyberakt" Namespace="CYBERAKT.WebControls.Navigation" Assembly="ASPnetMenu" %><html>
<head>
<title>Simple Context Menu</title>
<link href="../../../baseStyle.css" type="text/css" rel="stylesheet" >
<link href="menuStyle.css" type="text/css" rel="stylesheet" >
</head> <body>
<form id="Form1" method="post" runat="server"> <!-- Header ---------------------------------------------------------------------------------->
<table cellpadding="1" cellspacing="0" border="0" width="780">
<tr>
<td><a href="../../../default.aspx"><img src="../../../design/images/main_logo.gif" border="0"></a></td>
<td align="right" valign="bottom"><span class="TopNavLink">
<a href="http://www.aspnetmenu.com/tutorial.aspx">Read Tutorial</a> |
<a href="http://www.aspnetmenu.com/support.aspx">Contact Support</a> |
<a href="http://www.aspnetmenu.com/customerdownloads">Download Free Updates</a> |
<a href="http://www.aspnetmenu.com/pricing.aspx">Purchase a License</a></span>
</td>
</tr>
<tr>
<td colspan="2"><img src="../../../design/images/black.gif" width="100%" height="1" border="0"></td>
</tr>
<tr>
<td colspan="2" align="right"><font size="1">Version: 1.1</font></td>
</tr>
</table>
<!-- End Header ------------------------------------------------------------------------------> <br>
<span class="Hint">Right-click anywhere on the page to activate the context menu. </span> <cyberakt:ASPnetMenu id="Menu1"
MenuStyle="ClassicVertical"
MenuData="menuData.xml"
ExpandDelay="50"
IsContextMenu="true"
runat="server"
/>
<br><br><br><br><br>
<h3>Simple Context Menu</h3>
<ul>
<li>Context menus are created by simply setting the <b>IsContextMenu</b> property to <b>true</b>;</li>
<li>Notice how the menu automatically adjusts to window boundaries; </li>
</ul> <br><font size="1">
All source code files for this example are located in the following folder: <br>
<b>wwwroot/ASPnetMenu/Programming/CSharp/simpleContextMenu/</b>
</font> <br><br><br><br>
<a href="../../../default.aspx"><img src="../../../design/images/back.gif" border="0">Main Page</a>
<br><br><br>
<!-- Footer ----------------------------------------------------------------------------------->
<table cellpadding="1" cellspacing="0" border="0" width="780">
<tr>
<td colspan="2"><img src="../../../design/images/black.gif" width="780" height="1" border="0"></td>
</tr>
<tr>
<td><font size="1">
Rate our control on <a href="http://www.411asp.net/func/review/write?tree=411asp/assembly/navigator&id=4344310">www.411asp.net</a>
or <a href="http://www.asp.net/ControlGallery/ControlDetail.aspx?control=124&tabindex=2">www.asp.net</a>.</font>
</td>
<td align="right"><font size="1">Copyright © 2002-2003 CYBERAKT INC. All rights reserved. </font></td>
</tr>
</table>
<!-- End Footer -------------------------------------------------------------------------------></form></body>
</html>
<MenuData
ImagesBaseURL="images/"
DefaultItemSpacing="1"
DefaultGroupCssClass="MenuGroup"
DefaultItemCssClass="MenuItem"
DefaultItemCssClassOver="MenuItemOver" xmlns="ASP.NET Menu MenuData Schema">
<MenuGroup>
<MenuItem Label="Cut" LeftIcon="icon_cut.gif" LeftIconOver="icon_cut_over.gif" LeftIconWidth="20" ID="i_cut"/>
<MenuItem Label="Copy" LeftIcon="icon_copy.gif" LeftIconOver="icon_copy_over.gif" ID="i_copy"/>
<MenuItem Label="Delete" LeftIcon="icon_delete.gif" LeftIconOver="icon_delete_over.gif" ID="i_delete"/>
<MenuItem Image="gray.gif" Height="1" Width="110" CssClass="MenuBreak" CssClassOver="MenuBreak" />
<MenuItem Label="IntelliSense" RightIcon="arrow_right.gif" RightIconWidth="15">
<MenuGroup>
<MenuItem Label="List Members" LeftIcon="icon_listMembers.gif" LeftIconOver="icon_listMembers_over.gif" LeftIconWidth="20" ID="i_listMembers" />
<MenuItem Label="Parameter Info" LeftIcon="icon_parameterInfo.gif" LeftIconOver="icon_parameterInfo_over.gif" ID="i_paramInfo"/>
<MenuItem Label="Complete Word" LeftIcon="icon_completeWord.gif" LeftIconOver="icon_completeWord_over.gif" ID="i_completeWord" />
</MenuGroup>
</MenuItem>
<MenuItem Image="gray.gif" Height="1" Width="110" CssClass="MenuBreak" CssClassOver="MenuBreak" />
<MenuItem Label="Add New Item" LeftIcon="icon_addNewItem.gif" LeftIconOver="icon_addNewItem_over.gif" LeftIconWidth="20" ID="i_addNewItem"/>
<MenuItem Label="Add Existing Item" LeftIcon="icon_addExistingItem.gif" LeftIconOver="icon_addExistingItem_over.gif" ID="i_addExistingItem" />
</MenuGroup>
</MenuData> menuStyle.css文件中的内容.MenuGroup
{
background-image:url(images/background.gif);
border-width:1px;
border-color:#7E7E81;
border-style:solid;
cursor:default;
filter:progid:DXImageTransform.Microsoft.Shadow(color='gray', Direction=135, Strength=2);
}.TopMenuItem
{
background-color:#DBD7D0;
color:black;
font-family:MS Sans Serif;
font-size:12px;
border-width:1px;
border-color:#DBD7D0;
border-style:solid;
padding:2px;
padding-left:10px;
padding-right:10px;
cursor:default;
}.TopMenuItemOver
{
background-color:#C2C5C8;
color:black;
font-family:MS Sans Serif;
font-size:12px;
border-width:1px;
border-color:#A6A8B2;
border-style:solid;
padding:2px;
padding-left:10px;
padding-right:10px;
cursor:default;
}.MenuItem
{
color:black;
font-family:MS Sans Serif;
font-size:9px;
padding:5px;
padding-left:10px;
padding-right:10px;
cursor:default;
}.MenuItemOver
{
background-color:#C2C5C8;
color:black;
font-family:MS Sans Serif;
font-size:9px;
padding:5px;
padding-left:10px;
padding-right:10px;
cursor:default;
}.MenuBreak
{
margin-left:27px;
}
你用这个试试
<script language="javascript">
function openwin()
{var win=window.open("webform2.aspx","new_win","width=600px,length=1000px");}
</script>
<INPUT onclick="openwin()" style="Z-INDEX: 101; LEFT: 176px; POSITION: absolute; TOP: 304px" type="button" value="Button"></FONT>