I have run into the following problem: I want to run some javascript code at the client after returning from a postback. This is the test code I am executing:
Code:
If Page.IsPostBack Then
Dim mssg As String
mssg = "<script language='javascript'>"
mssg += "$(function () {"
mssg += "alert('Postback');"
mssg += "});"
mssg += "</script>"
Page.ClientScript.RegisterClientScriptBlock(GetType(Page), "recalculate", "mssg")
End If
I have used very similar code (without the $(function()... delay) in relation to a button 'click' event on another page where it works fine. In this case (postback) what happens is the word "mssg" is displayed on the screen. When I examine the source for the screen in the area where "mssg" is located I find this message:
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
When I start exploring this error message in microsoft Help, I find all sorts of suggestions such as downloading a new version of AJAX, altering some IIS settings, and changing settings on panels I have no knowledge of.
Does anyone have a simple solution to suggest?