Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Odd error with update panel and clientscript

$
0
0

I started with a webpage with the vb.net code behind where I passed an array of variables to Javascript through clientscript.registerclientscriptblock. I decided to add an update panel and had hoped to simply register the clientscriptblock on the Scriptmanager. The array of javascript variables needs to be available to the update panel. The tablenames variable is initialized in javascript. I went from this:

 Dim zzz As Integer = 0
Dim myJavaScript As StringBuilder = New StringBuilder()
 myJavaScript.Append("<script language='Javascript'>")
Do Until zzz = n
 'push the ids to javascript array
 myJavaScript.Append(vbCrLf)
 myJavaScript.Append("tablenames.push('" & processid(zzz) & "');")
 zzz = zzz + 1
 Loop
 myJavaScript.Append("</script")
ClientScript.RegisterClientScriptBlock(Me.GetType(), "clientscript", myJavaScript.ToString())

to this:
  Dim zzz As Integer = 0
        Dim myJavaScript As StringBuilder = New StringBuilder()
        myJavaScript.Append("<script language='Javascript'>")
        Do Until zzz = n
            'push the ids to javascript array

            myJavaScript.Append(vbCrLf)
            myJavaScript.Append("tablenames.push('" & processid(zzz) & "');")
            zzz = zzz + 1
        Loop
        myJavaScript.Append("</script")
     ScriptManager.RegisterClientScriptBlock(Me.UpdatePanel1, Me.UpdatePanel1.GetType(), "clientscript", myJavaScript.ToString(), False)

Now I am getting three different errors in the console of firebug.

ASP.NET Ajax client-side framework failed to load.

ReferenceError: Type is not defined Type._registerScript("MicrosoftAjaxWebForms.js", [

ReferenceError: Sys is not defined

Previously I had no errors in the console. I have another update panel running perfectly in this vb.net solution on another page. But this page is just not working. I have been all over the internet today and have found nothing which solves this problem.

Can ANYONE help?





Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>