473,508 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JavaScript vs runat=server problem

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
Mar 26 '06 #1
3 1523
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.

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:ux**************@TK2MSFTNGP12.phx.gbl...
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

Mar 26 '06 #2
I saw those forum answers that have you put script blocks right after the
<body /> but it does not work.
T

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:eM**************@tk2msftngp13.phx.gbl...
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.

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:ux**************@TK2MSFTNGP12.phx.gbl...
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


Mar 27 '06 #3
Tina,
put in OnPreRender :
this.mybody.attributes.Add("onload","setcursor();" )

HTH

Ciaran

"Tina" <ti**********@nospammeexcite.com> wrote in message
news:ux**************@TK2MSFTNGP12.phx.gbl...
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

May 29 '06 #4

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

Similar topics

4
9939
by: Matthew Louden | last post by:
It happend to me more than once. When I create web controls or move the positions in VS.NET, I encountered the following run-time errors: It doesn't matter what controls I create, the following...
3
4169
by: Russ | last post by:
I have a usercontrol that is loaded by a webform. The usercontrol populates a datagrid which users need the capability to export data from the grid to Excel. The problem is that when I attempt to...
4
13306
by: Alex Maghen | last post by:
I have a master page which contains a general page framework and also contains a <form runat=server> around most of the content of the page. Inside that <form> tag is a ContentPlaceholder. I...
7
6271
by: Alex Maghen | last post by:
I have some client-side JavaScript that I want to run whenever a pulldown <SELECT> is changes on th client. I'm trying to do this as follows... <select id="MyPulldown"...
7
13423
by: skeddy | last post by:
In a nutshell, I'm trying to dynamically create a select box with ResultSet code in vbscript and then need to be able to access the value of that select box later with a Save button. I've got...
8
2219
by: Maxwell2006 | last post by:
Hi, Using ASP.NET 2.0, I have this tag in my asp page: <td runat =server background="~/Images/Header2.gif">&nbsp;</td> The problem is when I run the page, the server side TD tag renders...
6
2518
by: den 2005 | last post by:
Hi everybody, Question 1: How do you set the values from server-side to a client-side control or how do you execute a javascript function without a button click event? Question 2: How do you...
4
13346
by: Erland | last post by:
Hello everyone, I am have couple of bad concepts and would like to clear things up. As I understand ASP.NET server controls contain runat=server tag and they only run on the server. But I've...
4
14983
by: John Dalberg | last post by:
I am looking at a problem which is preventing my code to get a reference to any asp control inside a div section which has a runat=server attribute. This can be reproduced in a simple test:...
0
7128
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
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7502
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
5635
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
4715
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
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
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 ...
0
426
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.