Solved

clinet side script doesn't work

Posted on 2004-05-01
4
230 Views
Last Modified: 2010-04-07
hi guys,

I am new with asp.net.
I have the following code:

<%@ Page Language="VB" %>
<script runat="server">
    Sub Page_Load(sender As Object, e As EventArgs)
        Button1.Attributes.Add("onmouseover", _
           "javascript:alert('ALERT ALERT!!!')")
    End Sub
</script>
<html>
<head>
</head>
<body>
    <form runat="server" ID="Form1">
        <asp:Button id="Button1" runat="server" Font-Bold="True"
         Font-Names="Verdana" Font-Size="Larger"
         Text="Click Me!" Enabled="true"></asp:Button>
    </form>
</body>
</html>



When I try to view it in the browser the alert box does not appear on the "onmouseover" event.
When I build it and browse it in the IDE it works fine.

Please help me,
Thanks
0
Comment
Question by:wolframjam
4 Comments
 
LVL 21

Expert Comment

by:tovvenki
Comment Utility
Hi,

try with the RegisterStartupScript method have a look at this url

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-usingjavascript.asp

I hope that this helps you.

regards,
venki
0
 
LVL 28

Expert Comment

by:mmarinov
Comment Utility
i've copied your code and paste it in a test page and in IE 6 it was working perfect
what browser do you test it under ?

B..M
0
 
LVL 30

Accepted Solution

by:
SteveGTR earned 500 total points
Comment Utility
Check to make sure that you do not have scripting disabled.
0
 

Author Comment

by:wolframjam
Comment Utility
Thank You All For Help.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now