>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.