473,507 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Executing Javascript from a web toolbar button

Hi all,

I have a web toolbar and a few buttons on it. On one of the buttons, I need
to execute some Javascript. I did put <span
onclick="javascript:alert('test');"></span> in the text property but this
does not work.

How can I execute some Javascript from one of these buttons?

Regards
John.
Nov 18 '05 #1
3 1655
Hi,
I tried the same code ( SPAN tag on click), it works fine. can u post the
exact
code, so we can get a clear picture.

Thanks,
Senthil.
"John" wrote:
Hi all,

I have a web toolbar and a few buttons on it. On one of the buttons, I need
to execute some Javascript. I did put <span
onclick="javascript:alert('test');"></span> in the text property but this
does not work.

How can I execute some Javascript from one of these buttons?

Regards
John.

Nov 18 '05 #2
Hi Senthil,

Here is the code:
Dim override As Microsoft.Web.UI.WebControls.ToolbarButton =
toolClaim.Items.Item(2)

override.ImageUrl = Session("ImagePath") & "override.jpg"

override.ToolTip = "Override"

override.Text = "<span onclick=""alert('Tester');""></span>"

Now the ImageURL as well as the ToolTip is working fine. I can see the span
section if I 'view source' on the html page but it doesn't execute. I know
it's not security settings since I have alerts that work throughout my app.

Any help appreciated . . .

Regards
John.
"Senthil Kumar" <Mindtree Consulting, India> wrote in message
news:37**********************************@microsof t.com...
Hi,
I tried the same code ( SPAN tag on click), it works fine. can u post the exact
code, so we can get a clear picture.

Thanks,
Senthil.
"John" wrote:
Hi all,

I have a web toolbar and a few buttons on it. On one of the buttons, I need to execute some Javascript. I did put <span
onclick="javascript:alert('test');"></span> in the text property but this does not work.

How can I execute some Javascript from one of these buttons?

Regards
John.

Nov 18 '05 #3

Try this instead:

override.ImageUrl = Session("ImagePath") & "override.jpg"

override.ToolTip = "Override"

'override.Text = "<span onclick=""alert('Tester');""></span>"

override.Attributes("onclick") = "alert('Tester');"

override.onClick is the ASP event, wherea
override.Attributes("onclick") is the tag attribute usable t
JavaScript

This is a much cleaner approac
-
Ryde
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Nov 18 '05 #4

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

Similar topics

3
2008
by: annon | last post by:
I've noticed that some problems come up frequently that are of importance in writing web pages, because they're pretty fundamental points. For general reference, here are some collected...
15
1833
by: Michael Hill | last post by:
I have this cf script below where the javascript in it works perfectly i.e. a new window opens when I press 'click me' when I call it up using the url in the browser. But when I "POST" to it...
14
5424
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
0
6414
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
2
1798
by: Ashish | last post by:
Hello, I am sick and tired of ochestrating server and client side scripts. Basically I am using toolbar from IE web controls and want to attach javascript to one of the buttons' click event. The...
9
4888
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
2
2667
by: 9icj4u613jeqrx8 | last post by:
Hi, I need some help with IE browser programming (in .NET). I'm trying to add a button to the IE toolbar, and on the click of the button open a popup window with a remote URL. Secondly, I'm...
1
2457
by: jmohan | last post by:
Dear Sir/Madam, I develop a website in asp.net with c#. And also, I develop a toolbar in the toolbar studio separately. Aim of the Website: Enabling the visitors to become a member of our...
0
1550
Frinavale
by: Frinavale | last post by:
I have a peculiar problem... Background: I have a function that I don't want the user to execute more than once while they are waiting for it to process; therefore, I disable all of the...
0
7223
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
7111
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
7485
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
5623
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,...
0
4702
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.