Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1465
$find() not finding
posted

Hello.

I have an AjaxEnabled web app, a Content page, and a WebDialog control on it named "dlgWait".

The control is initially hidden. The application is "Style Enabled" and am using "Default".

I've tied the call to "showDialog()" (below) to an image button.

When the javascript runs, variable "d" is null after $find() is called.

I can't figure it out.

I did notice that the javascript emitted from RegisterClientScriptBlock is not located between the <head></head> tags, because this is a content page.

Thanks in advance,

Mike 

Here's the code in the Content page to register the BLOCKED SCRIPT

' Emit javascript to show the dialog window when a new date is selected:
If Not ClientScript.IsClientScriptBlockRegistered("showDialog") Then
  Dim sb As New StringBuilder()
  Dim s As String = "<script language=""javascript"">"
  sb.Append(s)
  s =
"function showDialog() {"
  sb.Append(s)
  s =
"var d = $find(""dlgWait""); "
  sb.Append(s)
  s =
"d.show();"
  sb.Append(s)
  s =
"} </script>"
  sb.Append(s)
  ClientScript.RegisterClientScriptBlock(
Me.GetType(), "showDialog", sb.ToString(), False)
End If