473,385 Members | 2,069 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,385 software developers and data experts.

elements not loaded before RegisterStartupScript

In the page load event of my user control I create and register a
startup script with RegisterStartupScript. I am passing two controls
(using the ClientID property of the controls) into a function in the
startup script and I get
an undefined error on one of them (an image control) while the other
(a div) is found with no problem. Additionally even
if I comment out all references to the undefined control (except the
in the argument list for the function) I get the undefined error and
the function does not run. What the hell -- why should it stop with an
undefined argument if the argument is not used?

Please HELP!!!!

Aug 24 '07 #1
1 2325

You may wish to use Firebug and Firefox together to debug this , however in
regards to the objects not loading before the script executes - you either
need to push the script to be rendered at the end of the page, subscribe to
the body's onload event and do your stuff there or have a setTimeout that
tries to get the element , if it's null then wait naother 500-1000
milliseconds and check again.
Ideally - you're probably gonna be better off subscribing to the body's
onload event.
"Crazy Cat" wrote:
In the page load event of my user control I create and register a
startup script with RegisterStartupScript. I am passing two controls
(using the ClientID property of the controls) into a function in the
startup script and I get
an undefined error on one of them (an image control) while the other
(a div) is found with no problem. Additionally even
if I comment out all references to the undefined control (except the
in the argument list for the function) I get the undefined error and
the function does not run. What the hell -- why should it stop with an
undefined argument if the argument is not used?

Please HELP!!!!

Aug 25 '07 #2

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

Similar topics

3
by: gordon.lear | last post by:
I am using MSXML 4.0 I am grabbing numerous RSS News Feeds and trying to parse the data and read it into a dB. The problem is that the RSS News feeds are not all the same when tunneled down in...
9
by: josvanr | last post by:
HI I'm working on a site http://www.josvanriswick.nl/nieuw in which i use absolute positioning. On my pc at home i didn't notice, but now, as the site is on air and loading images is a bit...
0
by: rom | last post by:
my main aspx page has 3 user controls. they are all located in the same place of the page and each time i set the visibility of 2 of them to false and 1 to true. now, i want to use the...
7
by: sck10 | last post by:
Hello, I have the following sub in a class in my "App_Code" directory. The script is for setting focus on a particular control, but I get the error, "Name ClientScript Not declared". Also, I am...
1
by: vikas.khengare | last post by:
Hi friends I want to allow left click only on some controls but not on all controls like textbox/span elements. I have near about 30+ HTML controls on my web page. then It's bad idea that I...
0
by: Jesper Lund Stocholm | last post by:
I have problems with sending javascript to the client from a dynamically loaded usercontrol. I have a single page that dynamically loads controls into a table cell in a HTML-table. For one of...
3
by: MJP | last post by:
I have a button which kicks off the generation of a report after which the file will be downloaded. The report generation can take a long time, so client side onclick event of the button also...
3
by: Rob | last post by:
Hi, We've developed an ajax enabled web app which we're currently deploying to our production server. We use System.Web.UI.Page.RegisterStartupScript throughout the app, and all has worked well...
4
by: =?Utf-8?B?RHVuZTg4?= | last post by:
I've got some code that uses Page.ClientScript.RegisterStartupScript to call a javascript function from the Page_Load method in the code behind. The code works fine in IE but the javascript...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...

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.