473,795 Members | 3,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can menu items open new windows?

Hi all,
how can I use menu object to open a new window instead of postback to
the same page where the menu is? What I'd like to do is like invoking
"window.ope n()" (javascript) from a menu item.

Thanks in advance

Nov 20 '06 #1
4 13333
<ce*****@libero .itwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
how can I use menu object to open a new window instead of postback to
the same page where the menu is? What I'd like to do is like invoking
"window.ope n()" (javascript) from a menu item.
http://msdn2.microsoft.com/en-us/lib...et(VS.80).aspx
Nov 20 '06 #2
You can do that by setting the NavigateUrl property to a javascript function
that opens the new window
<asp:Menu ID="Menu1" runat="server">

<Items>

<asp:MenuItem Text="Javascrip t Menu" Value="Javascri pt Menu"
NavigateUrl="ja vascript:openWi n();" Target="_self"> </asp:MenuItem>

</Items>

</asp:Menu>

<script language=javasc ript>

function openWin()

{

window.open('De fault.aspx');

}

</script>

hope this helps

"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:Oa******** ******@TK2MSFTN GP03.phx.gbl...
<ce*****@libero .itwrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
>how can I use menu object to open a new window instead of postback to
the same page where the menu is? What I'd like to do is like invoking
"window.open() " (javascript) from a menu item.

http://msdn2.microsoft.com/en-us/lib...et(VS.80).aspx

Nov 20 '06 #3
"Onwuka Emeka" wrote:
You can do that by setting the NavigateUrl property to a javascript function
that opens the new window
<asp:Menu ID="Menu1" runat="server">
<Items>
<asp:MenuItem Text="Javascrip t Menu" Value="Javascri pt Menu"
NavigateUrl="ja vascript:openWi n();" Target="_self"> </asp:MenuItem>
</Items>
</asp:Menu>
Can you not just set the target to _blank?

<asp:MenuItem Text="Test Menu" Value="Test Menu"
NavigateUrl="So mePage.aspx" Target="_blank" ></asp:MenuItem>

Nov 20 '06 #4
"Leon Mayne" <Le*******@disc ussions.microso ft.comwrote in message
news:3B******** *************** ***********@mic rosoft.com...
Can you not just set the target to _blank?
Yes:
http://msdn2.microsoft.com/en-us/lib...et(VS.80).aspx
Nov 20 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1660
by: Ian Hinson | last post by:
The pop-up (drop-down?) menu items that appear in both built-in and custom menubars since Office 2000 now sometimes appear "sunken" and by default are not visible, unless the chevron is clicked at the bottom of the menu. How does Office determine which menu items are visible, and which items are sunken/initially not visible? I've noticed this happens with my custom menus too, but can't figure out the "rhyme or reason" that Office uses...
2
4194
by: DFS | last post by:
I inadvertently deleted all the items from the built-in Access97 Window menu: Tile Horizontally, Tile Vertically, Cascade, etc. Can I somehow get them back without reinstalling Access97 (or creating them as my own custom items)?
4
1765
by: Lynn Morrison | last post by:
I cannot find this feature at all. There is no bitmap property for menu items nor is there an imagelist property for the menu itself... How do I put images to the left of menu items? Thanks, Lynn
1
2469
by: zacks | last post by:
I have figured out how to add custom menu items to various buildin context menus by looking at a project on CodeProject.com and then doing some registry searches. But I can't find how to add a complex menu item, that is, a menu item that has a submenu, or possibly a sub-submenu. I also cannot figure out how to tell windows just where in the menu the new menu item should appear, or how to add a new separator line to setoff the new menu...
2
2605
by: Andrus | last post by:
To reproduce, run code, open file menu, press up and down arrows to move out of menu. Menu items are scrolled and blank items appears in end. I need to change visibility of menu items at runtime. How to fix this ? Is this .NET 3.5 bug ? Andrus.
13
2858
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see witch object was selected. This is the sub procedure that read the items from an Array and create the menutitem. The array hold more information to use in program when one of the items is selected. Dim finisharray(,) As String ' is set up...
3
2067
by: puneetmca | last post by:
hi....i have made a horizontal menu with some of the sub menu items using javascript and CSS...but when i open the sub menu items then the items are opened below the main menu by overlapping other items...but i want it should be open in right or left side....so that user can easily select the options..... can you help me out if there is any code or property in css for doing it........... thankz
8
5337
by: kulabhishek | last post by:
I am developing windows application using C# 3.0 and .NET framework 3.5. My application has many forms and on them many text boxes and uses XML as back end. I am using Windows XP SP3 and have installed east Asian languages. After installing east Asian languages, i am getting three extra menu items in the default context menu (cut, copy, paste context menu) for text box. These three options are : "Right to left Reading order", "Show Unicode...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10448
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10167
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9046
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7544
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6784
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.