473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Body onLoad Problem (ASP .NET & JavaScript)

Hi all.
I have a simple default.aspx file where I declare a JavaScript
function:

<script type="text/javascript" language="JavaScript">
....
function rotate() {
....
}
</script>
</head>

and, after that, I insert

<body ID="body1" runat="server">.

So, this is my problem: why does the validator tell me that "body1 is
not a member of _default" (error BC30456) if in default.aspx.vb I write
the following statement?

Me.body1.Attributes.Add("onLoad", "rotate()")

What I am trying to do is to call "rotate" function on body load..can
anyone help me?

Thanks in advance!!

Nov 21 '06 #1
1 2259
Try doing it the "old fashioned" way:

<body onload="rotate();">

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ce*****@libero.it" wrote:
Hi all.
I have a simple default.aspx file where I declare a JavaScript
function:

<script type="text/javascript" language="JavaScript">
....
function rotate() {
....
}
</script>
</head>

and, after that, I insert

<body ID="body1" runat="server">.

So, this is my problem: why does the validator tell me that "body1 is
not a member of _default" (error BC30456) if in default.aspx.vb I write
the following statement?

Me.body1.Attributes.Add("onLoad", "rotate()")

What I am trying to do is to call "rotate" function on body load..can
anyone help me?

Thanks in advance!!

Nov 21 '06 #2

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

Similar topics

8
by: alanstew | last post by:
With the body tag calling out 'window onload', a function with a 'window.open' fails at the 'window.open' line. If I cut out the body tag, the function executes as normal. At first I thought it...
6
by: skubik | last post by:
Hi everyone. I'm attempting to write a Javascript that will create a form within a brand-new document in a specific frame of a frameset. The problem is that I can create the form and input...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
6
by: tshad | last post by:
Is there a way during Page_Load to change or add an attribute to the Body tag? I want to be able to change the onLoad body attribute to do a focus on one of my text boxes, such as: ...
0
by: Andy Fish | last post by:
Hi, I managed to figure this one out for myself but thought I would post it here for the general good. I have an asp.net 1.1 application which was using smart navigation and also had a <body...
4
by: Jason | last post by:
Hi, Here's the scenario: I have a web application that has window A and window B. A user has both window A and B open - window A is in the foreground and window B is behind it. If the...
2
by: Kees de Winter | last post by:
In an ASP.NET 2.0 application using masterpages, how can I add a 'load' and 'unload' JavaScript function to the body tag for some aspx page that uses the masterpage. I don't want to add it to the...
9
by: Tonio Tanzi | last post by:
I have an asp page with this tag <body onLoad="show_msg('<%=error_msg%>');"> where "show_msg" is a javascript function that shows the message contained in the asp variable "error_msg" only if...
2
by: WGW | last post by:
Hello all, I need another set of eyes cause it just isn't working, no matter how identical I make it. The initRotator function works when called by itself, but when adding another function, only the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...

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.