Link to home
Start Free TrialLog in
Avatar of wolframjam
wolframjamFlag for Germany

asked on

clinet side script doesn't work

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
Avatar of tovvenki
tovvenki

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
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
ASKER CERTIFIED SOLUTION
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wolframjam

ASKER

Thank You All For Help.