473,396 Members | 2,020 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,396 software developers and data experts.

Client code on MenuItem

I have not used MenuItems before and I want to have the click of an item run
a local Javascript function rather than asp.net code. I did not see a
OnClientClick option. How do I do this? Thanks.

David
Feb 5 '08 #1
2 2786
"David C" <dl*****@lifetimeinc.comwrote in message
news:Ow**************@TK2MSFTNGP04.phx.gbl...
I have not used MenuItems before and I want to have the click of an item
run a local Javascript function rather than asp.net code. I did not see a
OnClientClick option. How do I do this?
<asp:MenuItem Text="Hello" NavigateUrl="javascript:alert('Hello');" />
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Feb 5 '08 #2
Thank you.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
"David C" <dl*****@lifetimeinc.comwrote in message
news:Ow**************@TK2MSFTNGP04.phx.gbl...
>I have not used MenuItems before and I want to have the click of an item
run a local Javascript function rather than asp.net code. I did not see
a OnClientClick option. How do I do this?

<asp:MenuItem Text="Hello" NavigateUrl="javascript:alert('Hello');" />
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Feb 5 '08 #3

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

Similar topics

3
by: Abubakar | last post by:
HI all, working in the vs.net 2k5 beta 2, I write the following code which gives me an exception: ContextMenu textboxmenu = textBox2.ContextMenu; MenuItem menuitem = new MenuItem("hello"); ...
1
by: Tim::.. | last post by:
Hi can someone please explain to me why I get the following error when I place the following code into a server control. It worked fine until I created the control??? Error:...
8
by: gumi | last post by:
Hi, I am looking for code for a alarm clock program that pops up a messege to be used as part of my VB.Net class project. Any help is very much appreciated. Thanks
1
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code:...
2
by: **Developer** | last post by:
I've been asking about a Menu problem I have without results. So here is a test case I've developed that shows the problem. Simply create a soultion with one project containg one form and...
6
by: cj | last post by:
Lets just take this example I'm looking at now. I'm looking at the help screen titled .NET Framework Class Library FolderBrowserDialog Class . It gives an example at the bottom that begins with:...
14
by: Charles Jenkins | last post by:
I want to make a MenuItem that I can 'click' programmatically. I started by coding this: class ClickableMenuItem : MenuItem { public void DoClick( EventArgs e ) { OnClick( e ); } ...
2
by: Woody714 | last post by:
I'm fairly new to C++ and have an assignment that is knocking me out. The text file is fairly simple: Plain Egg 1.45 Bacon and Egg 2.45 Muffin 0.99..... etc....
26
by: Jenitha S | last post by:
Hi, I am working in JSP code.A Menubar is displayed in JSP page.It's working fine in IE. But in case of firefox the very first menuitem is not working.If i move that menu item as second means it's...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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
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...
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
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...

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.