469,077 Members | 1,415 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,077 developers. It's quick & easy.

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 2150
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by skubik | last post: by
2 posts views Thread by laredotornado | last post: by
6 posts views Thread by tshad | last post: by
2 posts views Thread by Kees de Winter | last post: by
2 posts views Thread by WGW | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.