"OnClick" does work but, the java script that I am using is for slow page loads. The java script shades the web page and show a message box saying "Please wait page is loading....". When I use the
"OnClick" it shades the web page and shows the message box, but does not disappear after the new page is done loading. The "OnClientClick" does shade the web page and shows the message box and then
does show the new page when it is done loading.
At the runtime, there is no property called OnClientClick. It will render as onclick. In other words, raw HTML controls does not have an attribute called OnClientClick. OnClientClick is just an attribute provided by asp.net server controls to make the task
easier and convenient. Every control will render as HTML controls, so adding onclick attribute is the way to run the javascript even in asp.net controls.
Ruchira
All-Star
42936 Points
7023 Posts
MVP
Re: How do I do a "OnClientClick" for a navigation menu?
Apr 30, 2012 01:45 PM|LINK
At the runtime, there is no property called OnClientClick. It will render as onclick. In other words, raw HTML controls does not have an attribute called OnClientClick. OnClientClick is just an attribute provided by asp.net server controls to make the task easier and convenient. Every control will render as HTML controls, so adding onclick attribute is the way to run the javascript even in asp.net controls.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.