Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Client Script
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01317676
Message ID:
01318092
Views:
14
>Hi everybody,
>
>I need to be able to dynamically show the message. The code I'm trying to use is

Javascript code starts executing as soon as it's loaded (remember, the page isn't loaded all at once, it's streamed), so you've got a few problems with the code you've shown. First, your code is referencing controls before the controls are even available to the page, ex. "var dv = document.getElementById" will fail because the controls haven't been processed yet. So that code needs to be moved below the elements it references (or, just move the var statements to within the function). Also, the RegisterClientScriptBlock injects the Javascript right after the < form element of the page, so it's still going to run your code too soon. Use RegisterStartupScript instead, which places the code right before the < /form ending tag. That (should) fix the problem.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform