Wrox Programmer Forums
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 24th, 2013, 05:01 PM
Authorized User
Join Date: Oct 2012
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default Run Script After Postback

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:
	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?

Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't get the postback in chapter 12 to run. rhoisy BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 August 22nd, 2008 07:36 AM
cant run my script! angelic_scars Beginning PHP 1 November 9th, 2006 12:17 AM
RegisterStartupScript - Postback from script gp_mk General .NET 4 April 14th, 2004 05:12 AM
Postback from client script gp_mk HTML Code Clinic 2 April 14th, 2004 02:48 AM
Call and run CGI script from a PHP script ... how? dbruins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 10th, 2003 03:09 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.