JavaScript vs runat=server problem

T

Tina

I have been running a javascript function called from <body
onload="setcursor" ....

But recently I had to add id="mybody" and runat="server to that body tag for
other reasons. Now it won't run my javascript because it apparently thinks
I'm calling a server side function.

How can I execute a javascript function from the body where I also have
runat"server" ?

Thanks,
T
 
P

Peter Rilling

Try one of the other ways of attaching handlers, for instance, you can use
the <script ...> element to attach an event to an object. Take a look at
the documentation for the onload JS event.
 
T

Tina

I saw those forum answers that have you put script blocks right after the
<body /> but it does not work.
T
 
C

Ciaran

Tina,
put in OnPreRender :
this.mybody.attributes.Add("onload","setcursor();")

HTH

Ciaran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top