下面在我的 aspx 页面的我的菜单控件代码中
<table width="100%" cellpadding="0" cellspacing="0" style="background-color: Black; height: 30px; ">
<tr style="background-color: Black; height: 30px;">
<td style="background-color: Black; width: 100%; height: 30px;">
<div style="height:30px">
<asp:Menu ID="NavigationMenu" runat="server" EnableViewState="false" RenderingMode="Default" CssClass="menu" ForeColor="White"
IncludeStyleBlock="false" Orientation="Horizontal" Height="30px" OnMenuItemClick="NavigationMenu_MenuItemClick" >
<StaticMenuItemStyle CssClass="menuitem" />
<DynamicMenuItemStyle CssClass="menuitem" />
<Items>
<asp:MenuItem NavigateUrl="~/Home.aspx" Text="Home" ToolTip="Home page" />
<asp:MenuItem NavigateUrl="~/CommonUser.aspx" Text="Create / Edit User Access" ToolTip="Provide access to users" />
<asp:MenuItem NavigateUrl="~/BulkUpload.aspx" Text="Bulk Upload" ToolTip="To bulk upload users " />
<asp:MenuItem NavigateUrl="~/SearchUser.aspx" Text="View / Revoke User Access" ToolTip="View existing users access" />
<asp:MenuItem Text="Admin" NavigateUrl="javascript:void(0);">
<asp:MenuItem NavigateUrl="javascript:void(0);" Text="User" ToolTip="Create / Edit User for the application">
<asp:MenuItem Text="Create User" NavigateUrl="~/AdminUser.aspx" />
<asp:MenuItem Text="Edit User" NavigateUrl="~/EditAdminUser.aspx" />
</asp:MenuItem>
<asp:MenuItem Text="Template" NavigateUrl="javascript:void(0);">
<asp:MenuItem Text="Create Template" />
<asp:MenuItem Text="Edit Template" />
</asp:MenuItem>
<asp:MenuItem NavigateUrl="javascript:void(0);" Text="Server" ToolTip="Add / Edit server Details">
<asp:MenuItem Text="Add Server" NavigateUrl="~/AddServers.aspx" />
<asp:MenuItem Text="Edit Server" NavigateUrl="~/EditServer.aspx" />
</asp:MenuItem>
<asp:MenuItem NavigateUrl="~/CreateConString.aspx" Text="Environment Password" ToolTip="Change password for connection string" />
</asp:MenuItem>
</Items>
</asp:Menu>
</div>
</td>
</tr>
</table>
我有 2 个问题
- 我无法选择子菜单。他们正在显示但无法选择它。一旦我将鼠标移到子菜单上,子菜单就会消失
- 菜单在最大化窗口时移动到屏幕左侧。在鼠标悬停事件菜单正确对齐
下面是代码是如果在 IE 视图源中查看它
<table width="100%" cellpadding="0" cellspacing="0" style="background-color: Black; height: 30px; ">
<tr style="background-color: Black; height: 30px;">
<td style="background-color: Black; width: 100%; height: 30px;">
<div style="height:30px">
<a href="#NavigationMenu_SkipLink"><img alt="Skip Navigation Links" src="/FacetsUserSetupApp/WebResource.axd?d=E02KDPXufVQc2nUrHjGfkA2&t=634836496018543211" width="0" height="0" style="border-width:0px;" /></a><div class="menu" id="NavigationMenu">
<ul class="level1">
<li><a title="Home page" class="level1 menuitem" href="Home.aspx">Home</a></li><li><a title="Provide access to users" class="level1 menuitem" href="CommonUser.aspx">Create / Edit User Access</a></li><li><a title="To bulk upload users " class="level1 menuitem" href="BulkUpload.aspx">Bulk Upload</a></li><li><a title="View existing users access" class="level1 menuitem" href="SearchUser.aspx">View / Revoke User Access</a></li><li><a class="popout level1 menuitem" href="javascript:void(0);">Admin</a><ul class="level2">
<li><a title="Create / Edit User for the application" class="popout level2 menuitem" href="javascript:void(0);">User</a><ul class="level3">
<li><a class="level3 menuitem" href="AdminUser.aspx">Create User</a></li><li><a class="level3 menuitem" href="EditAdminUser.aspx">Edit User</a></li>
</ul></li><li><a class="popout level2 menuitem" href="javascript:void(0);">Template</a><ul class="level3">
<li><a class="level3 menuitem" href="#" onclick="__doPostBack('ctl00$NavigationMenu','Admin\\Template\\Create Template')">Create Template</a></li><li><a class="level3 menuitem" href="#" onclick="__doPostBack('ctl00$NavigationMenu','Admin\\Template\\Edit Template')">Edit Template</a></li>
</ul></li><li><a title="Add / Edit server Details" class="popout level2 menuitem" href="javascript:void(0);">Server</a><ul class="level3">
<li><a class="level3 menuitem" href="AddServers.aspx">Add Server</a></li><li><a class="level3 menuitem" href="EditServer.aspx">Edit Server</a></li>
</ul></li><li><a title="Change password for connection string" class="level2 menuitem" href="CreateConString.aspx">Environment Password</a></li>
</ul></li>
</ul>
</div><a id="NavigationMenu_SkipLink"></a>
</div>
</td>
</tr>
</table>
我不确定如何为 A 控件使用 rendercompatibility 属性。任何人都可以请帮助我为菜单控件声明相同的内容