473,395 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.open()" (javascript) from a menu item.

Thanks in advance

Nov 20 '06 #1
4 13284
<ce*****@libero.itwrote in message
news:11**********************@k70g2000cwa.googlegr oups.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 #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="Javascript Menu" Value="Javascript Menu"
NavigateUrl="javascript:openWin();" Target="_self"></asp:MenuItem>

</Items>

</asp:Menu>

<script language=javascript>

function openWin()

{

window.open('Default.aspx');

}

</script>

hope this helps

"Mark Rae" <ma**@markNOSPAMrae.comwrote in message
news:Oa**************@TK2MSFTNGP03.phx.gbl...
<ce*****@libero.itwrote in message
news:11**********************@k70g2000cwa.googlegr oups.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="Javascript Menu" Value="Javascript Menu"
NavigateUrl="javascript:openWin();" 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="SomePage.aspx" Target="_blank"></asp:MenuItem>

Nov 20 '06 #4
"Leon Mayne" <Le*******@discussions.microsoft.comwrote in message
news:3B**********************************@microsof t.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
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...
2
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...
4
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, ...
1
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...
2
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...
13
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...
3
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...
8
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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,...

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.