Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 October 14th, 2011, 11:46 AM
Authorized User
 
Join Date: Aug 2010
Posts: 50
Thanks: 7
Thanked 0 Times in 0 Posts
Default Script Manager

Hi Imar,

I keep getting this Script Manager error. Can you help me out. Thanks.


[InvalidOperationException: The control with ID 'UpdatePanel1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.]
System.Web.UI.UpdatePanel.get_ScriptManager() +474740
System.Web.UI.UpdatePanel.RegisterPanel() +2515953
System.Web.UI.UpdatePanel.OnInit(EventArgs e) +19
System.Web.UI.Control.InitRecursive(Control namingContainer) +140
System.Web.UI.Control.InitRecursive(Control namingContainer) +311
System.Web.UI.Control.InitRecursive(Control namingContainer) +311
System.Web.UI.Control.InitRecursive(Control namingContainer) +311
System.Web.UI.Control.InitRecursive(Control namingContainer) +311
System.Web.UI.Control.InitRecursive(Control namingContainer) +311
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +480


here is the code
Code:
<script type="text/javascript">
    function ValidatePhoneNumbers(source, args) {
        var phoneHome = document.getElementById('<%= PhoneHome.ClientID %>');
        var phoneBusiness = document.getElementById('<%= PhoneBusiness.ClientID %>');
        if (phoneHome.value != '' || phoneBusiness != '') {
            args.IsValid = true;
        }
        else {
            args.IsValid = false;
        }
    }
</script>
<asp:UpdatePanel runat="server" ID="UpdatePanel1">
    <ContentTemplate>
 
Old October 14th, 2011, 01:48 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

As the error message suggest, in order to use an UpdatePanel, your page needs a ScriptManager. If you're following along with the book, the ScriptManager can be found in the Master Page. If it's not there you can drag one from the toolbox. The AJAX chapter shows how to do this.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
[Apache_Tomcat]: $CATALINA_HOME/webapps/host-manager/manager.xml quanba Apache Tomcat 1 September 1st, 2011 07:16 PM
Ajax - Script manager - Sys.Webforms.PageRequestManagerParserErrorExceptio n nkvd3941 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 0 April 30th, 2010 02:58 AM
Change the order of client script / server script rupen ASP.NET 2.0 Basics 3 April 16th, 2009 01:41 PM
script manager MunishBhatia Ajax 0 January 29th, 2009 10:22 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.