如何启用“在新标签页中打开”右键单击我的菜单时选项

如何启用“在新标签页中打开”右键单击我的菜单时选项

问题描述:





我使用asp.net 2008开发了一个网页。我使用了aps:menu来链接其他页面。链接正确打开。但我的问题是,当我右键单击菜单中的任何链接时,在新选项卡中打开和在新窗口中打开选项被禁用。如何启用?我的代码如下:




Hi,

I developed a webpage using asp.net 2008. I have used aps:menu to link other pages. The links are opened properly. But my problem is, when I right click on any link in the menu, "open in a new tab" and "open in a new window" options are disabled. How to enable this? My code follows


<asp:Menu ID="Menu3" runat="server" Font-Bold="True" Font-Names="Calibri"

           Font-Size="Small" ForeColor="#000099" Orientation="Horizontal"

               style="position:absolute ;  z-index: 5; left: 750px; top: 5px;  height: 28px;
           width: 200px; text-align: center;">
           <StaticSelectedStyle Font-Underline="True" ForeColor="Black" />
           <StaticHoverStyle ForeColor="#FF0066"  Font-Bold="True" />
           <Items>
               <asp:MenuItem SeparatorImageUrl="~/images/MenuSplitBar.jpg" Text="Home"

                   Value="Home">
               </asp:MenuItem>
               <asp:MenuItem SeparatorImageUrl="~/images/MenuSplitBar.jpg" Text=" Enquiry"

                   Value=" Enquiry"  ></asp:MenuItem>
               <asp:MenuItem Text="Service Request"

                   Value="ServiceRequest"></asp:MenuItem>
           </Items>
       </asp:Menu>





我正在使用vb来编写链接到菜单。代码如下





I am using vb to write linksto the menu. the code as follows

Protected Sub Menu3_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu3.MenuItemClick
       Select Case e.Item.Value
           Case "Home"
               Response.Redirect("Default.aspx")
           Case " Enquiry"
               Response.Redirect("Enquiry.aspx")
           Case "ServiceRequest"
               Response.Redirect("ServiceRequest.aspx")
       End Select
   End Sub

b $ b

请帮我解决thias问题。



Kindly help me to solve thias problem.

你可以使用属性 Target =_ blank在新窗口中打开。



这里的样本 MenuItem.Target Property [ ^ ]
You can use property Target="_blank" to open in new window.

Sample one here MenuItem.Target Property[^]


string url = "URL.aspx";
HttpContext.Current.Response.Write("<SCRIPT LANGUAGE='JavaScript'>window.open('" + url + "', '_new');</SCRIPT>");