Webpart Error - Script controls may not be registered before PreRender

Last post 11-29-2006 9:12 AM by johnnyQuest. 19 replies.

Sort Posts:

  • Webpart Error - Script controls may not be registered before PreRender

    11-15-2006, 1:14 PM
    • Member
      20 point Member
    • gillou01
    • Member since 11-15-2006, 6:08 PM
    • Posts 4

    I cant seem to make the webpartmanager work with the newest release of ajax and the november CTP

    I have a very simple page with just a wepartzone and a calendar but as soon as i tried to replace the asp:wepbartmanager by the ajax one i get an error saying

    Script controls may not be registered before PreRender

     

    here is my web.config:

     <?xml version="1.0"?>

    <configuration>

    <configSections>

    <sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <section name="converters" type="Microsoft.Web.Configuration.ConvertersSection"/>

    <sectionGroup name="scripting" type="Microsoft.Web.Configuration.ScriptingSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <sectionGroup name="webServices" type="Microsoft.Web.Configuration.ScriptingWebServicesSectionGroup, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

    <section name="jsonSerialization" type="Microsoft.Web.Configuration.ScriptingJsonSerializationSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>

    <section name="profileService" type="Microsoft.Web.Configuration.ScriptingProfileServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>

    <section name="authenticationService" type="Microsoft.Web.Configuration.ScriptingAuthenticationServiceSection, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>

    </sectionGroup>

    </sectionGroup>

    </sectionGroup>

    </configSections>

     

    <system.web>

    <pages>

    <controls>

    <add tagPrefix="asp" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <add tagPrefix="asp" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI" assembly="Microsoft.Web.Preview"/>

    <add tagPrefix="asp" namespace="Microsoft.Web.Preview.UI.Controls" assembly="Microsoft.Web.Preview"/>

    </controls>

    <tagMapping>

    <add tagType="System.Web.UI.WebControls.WebParts.WebPartManager"

    mappedTagType="Microsoft.Web.Preview.UI.Controls.WebParts.WebPartManager"/>

    <

    add tagType="System.Web.UI.WebControls.WebParts.WebPartZone"

    mappedTagType="Microsoft.Web.Preview.UI.Controls.WebParts.WebPartZone"/>

    <

    add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CompareValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <

    add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CustomValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <

    add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RangeValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <

    add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RegularExpressionValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <

    add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RequiredFieldValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <

    add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Microsoft.Web.UI.Compatibility.ValidationSummary, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </

    tagMapping>

    </

    pages>

    <compilation debug="true">

    <

    assemblies>

    <

    add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </

    assemblies>

    </

    compilation>

    <

    httpHandlers>

    <

    remove verb="*" path="*.asmx"/>

    <

    add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <

    add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>

    <

    add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>

    </

    httpHandlers>

    <

    httpModules>

    <

    add name="WebResourceCompression" type="Microsoft.Web.Handlers.WebResourceCompressionModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </

    httpModules>

    </

    system.web>

     

    <

    microsoft.web>

    <

    converters>

    <

    add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>

    <

    add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>

    <

    add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>

    </

    converters>

    <

    scripting>

    <

    webServices>

    </webServices>

    </

    scripting>

    </

    microsoft.web>

    <

    system.webServer>

    <

    validation validateIntegratedModeConfiguration="false"/>

    <

    modules>

    <

    add name="ScriptModule" preCondition="integratedMode" type="Microsoft.Web.UI.ScriptModule, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </

    modules>

    <

    handlers>

    <

    remove name="WebServiceHandlerFactory-ISAPI-2.0"/>

    <

    add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    <

    add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>

    </

    handlers>

    </

    system.webServer>

    </

    configuration>

     

     

    and here is the code of my page:

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <!

    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <

    html xmlns="http://www.w3.org/1999/xhtml">

    <

    head runat="server">

    <title>Untitled Page</title>

    </

    head>

    <

    body>

    <form id="form1" runat="server">

    <asp:ScriptManager ID="ScriptManager1" runat="server" />

     

    <asp:WebPartManager ID="WebPartManager1" runat="server" />

    <asp:WebPartZone ID="LeftWebPartZone" runat="server">

    <ZoneTemplate>

    <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>

    </ZoneTemplate>

    </asp:WebPartZone>

     

    <div>

    </div>

    </form>

    </

    body>

    </

    html>

    Any idea?

     Thanks

     

  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-15-2006, 2:22 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    web parts added by the preview bits will only let you have drag-n-drop in firefox. you can't put them inside an updatepanel and use partial postbacks to refresh their positioning.

    btw, the error you're having...are you sure you're using beta2 and the november ctp? i've just tedted a simple page here and it worked as expected. 

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-16-2006, 9:34 AM
    • Member
      20 point Member
    • gillou01
    • Member since 11-15-2006, 6:08 PM
    • Posts 4

    could you send me the code you r using for your simple test? because i m using beta2 and the november ctp.

     

    Thanks

     

  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-16-2006, 7:05 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    sure:

     

    aspx 

    <%@ Page Language="C#" %>
    <%@ Register src="webpart1.ascx" TagName="webpart1" TagPrefix="uc1" %>
    <%@ Register Namespace="Microsoft.Web.Preview.UI.Controls.WebParts" TagPrefix="fr" Assembly="Microsoft.Web.Preview" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (this.User.Identity.IsAuthenticated)
            {
                manager.DisplayMode = System.Web.UI.WebControls.WebParts.WebPartManager.DesignDisplayMode;
                this.ClientScript.RegisterStartupScript(this.GetType(),
                    "page",
                    "document.getElementById('aut').style.display = 'none';",
                    true);
            }
            else
            {
                this.ClientScript.RegisterStartupScript(this.GetType(),
                    "page",
                    "document.getElementById('zone1').style.display = 'none';document.getElementById('zone2').style.display = 'none';",
                    true);
            }
           
        }
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
        <style type="text/css">
           
           
            #zone1
            {
                position:relative;
                float: left;
                width: 350px;
                height: 500px;
                border: dashed 1px red;
            }
           
            #zone2
            {
                position:relative;
                float: right;
                width: 350px;
                height: 500px;
                border: dashed 1px red;
            }     
        </style>
        <script type="text/javascript">
            function login()
            {
                  Sys.Services.AuthenticationService.login(
                                        $get("username").value, //username
                                        $get("pass").value, //password
                                        false, //persisten
                                        null, //customInfo
                                        null, //redirect url
                                        callback ); //callback method                                 
            }
           
            function callback( res )
            {
                if( res )
                {
                   $get("aut").style.display = "none";
                   $get("zone1").style.display = "";
                   $get("zone2").style.display = "";
                   $get("refresher").click();
                }
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager runat="server" ID="scrmanager" />
            <div id="aut">
                <span>Nome de utilizador:</span>
                <input type="text" id="username" />
                <br />
                <span>Palavra-chave:</span>
                <input type="password" id="pass" />
                <br />
                <input type="button" value="Login" onclick="login()" />
            </div>
           
        
                    <fr:WebPartManager runat="server" id="manager" />
                   
                    <div id="zone1" runat="server">
                        <fr:WebPartZone ID="WebPartZone2" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
                            Padding="6">
                            <PartChromeStyle BackColor="#E3EAEB" BorderColor="#C5BBAF" Font-Names="Verdana" ForeColor="#333333" />
                            <MenuLabelHoverStyle ForeColor="Yellow" />
                            <EmptyZoneTextStyle Font-Size="0.8em" />
                            <MenuLabelStyle ForeColor="#333333" />
                            <MenuVerbHoverStyle BackColor="#E3EAEB" BorderColor="#CCCCCC" BorderStyle="Solid"
                                BorderWidth="1px" ForeColor="#333333" />
                            <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
                            <ZoneTemplate>
                                <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
                            </ZoneTemplate>
                            <MenuVerbStyle BorderColor="#1C5E55" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
                            <PartStyle Font-Size="0.8em" ForeColor="#333333" />
                            <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
                            <MenuPopupStyle BackColor="#1C5E55" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
                                Font-Size="0.6em" />
                            <PartTitleStyle BackColor="#1C5E55" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
                        </fr:WebPartZone>
                   
                    </div>
                   
                    <div id="zone2"  runat="server">
                        <fr:WebPartZone ID="WebPartZone1" runat="server" BorderColor="#CCCCCC" Font-Names="Verdana"
                            Padding="6">
                            <PartChromeStyle BackColor="#E3EAEB" BorderColor="#C5BBAF" Font-Names="Verdana" ForeColor="#333333" />
                            <MenuLabelHoverStyle ForeColor="Yellow" />
                            <EmptyZoneTextStyle Font-Size="0.8em" />
                            <MenuLabelStyle ForeColor="#333333" />
                            <MenuVerbHoverStyle BackColor="#E3EAEB" BorderColor="#CCCCCC" BorderStyle="Solid"
                                BorderWidth="1px" ForeColor="#333333" />
                            <HeaderStyle Font-Size="0.7em" ForeColor="#CCCCCC" HorizontalAlign="Center" />
                            <ZoneTemplate>
                                <uc1:webpart1 ID="Webpart1_1" runat="server" />
                            </ZoneTemplate>
                            <MenuVerbStyle BorderColor="#1C5E55" BorderStyle="Solid" BorderWidth="1px" ForeColor="White" />
                            <PartStyle Font-Size="0.8em" ForeColor="#333333" />
                            <TitleBarVerbStyle Font-Size="0.6em" Font-Underline="False" ForeColor="White" />
                            <MenuPopupStyle BackColor="#1C5E55" BorderColor="#CCCCCC" BorderWidth="1px" Font-Names="Verdana"
                                Font-Size="0.6em" />
                            <PartTitleStyle BackColor="#1C5E55" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
                        </fr:WebPartZone>       
                    </div>
                    <asp:Button ID="refresher" runat="server" style="display: none" />
                    
                   
             
        </form>
    </body>
    </html>

     webpart1.ascx

    <%@ Control Language="C#" ClassName="webpart1" %>

    <script runat="server">
        void HandleClick(object sender, EventArgs args)
        {
            info.Text = DateTime.Now.ToString();
        }
    </script>
    <span>Introduza o seu nome</span>
    <asp:TextBox runat="server" ID="txt" />
    <asp:Button runat="server" ID="bt" Text="Actualizar data de alteração" OnClick="HandleClick" />
    <br />
    <span>Última alteração:</span>
    <asp:Literal runat="server" ID="info" />
     

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-20-2006, 12:43 PM
    • Member
      20 point Member
    • gillou01
    • Member since 11-15-2006, 6:08 PM
    • Posts 4

    Hi

    i used your code, exactly and i still get this error (see below)

    I am using it on a french windows xp sp2 with the latest build of Atlas and of the CTP

    Any idea? i would really appreciate it

     

    Thanks

     

     

     

     

     

     

    Erreur du serveur dans l'application '/AJAXCTPEnabledWebSite2'.

    Script controls may not be registered before PreRender.

    Description : Une exception non gĂ©rĂ©e s'est produite au moment de l'exĂ©cution de la demande Web actuelle. ContrĂ´lez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.

    Détails de l'exception: System.InvalidOperationException: Script controls may not be registered before PreRender.

    Erreur source:

    Une exception non gérée s'est produite lors de l'exécution de la demande Web actuelle. Les informations relatives à l'origine et l'emplacement de l'exception peuvent être identifiées en utilisant la trace de la pile d'exception ci-dessous.

    Trace de la pile:

    [InvalidOperationException: Script controls may not be registered before PreRender.]
       Microsoft.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +112
       Microsoft.Web.UI.ScriptManager.RegisterScriptControl(TScriptControl scriptControl) +100
       Microsoft.Web.Preview.UI.Controls.WebParts.WebPartManager.OnInit(EventArgs e) +148
       System.Web.UI.Control.InitRecursive(Control namingContainer) +460
       System.Web.UI.Control.InitRecursive(Control namingContainer) +272
       System.Web.UI.Control.InitRecursive(Control namingContainer) +272
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1745
    


    Informations sur la version : Version Microsoft .NET Framework :2.0.50727.42; Version ASP.NET :2.0.50727.210
  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-20-2006, 1:25 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    well, you're using at least an old version of the CTP. if you use the november ctp, that bug will go away... 

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-21-2006, 4:30 AM
    • Member
      20 point Member
    • gillou01
    • Member since 11-15-2006, 6:08 PM
    • Posts 4

    hi,

    what makes you say that? i have installed the latest build of the CTP that i could find on ajax web site

    The version of the Microsoft.Web.Preview.dll is 1.0.61025.0.

     

  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-21-2006, 4:43 AM
    • Member
      20 point Member
    • rinando
    • Member since 11-13-2006, 10:48 AM
    • Posts 4

    Hi,

     I've got the same problem, but I found out that when I put the line with <fr:WebPartManager> above the <asp:ScriptManager> using <asp:WebPartZone> the error disappears. But when I use <fr:WebPartZone> the error is back.

    My version of Microsoft.Web.Preview.dll is also 1.0.61025.0. (2 nov 2006)

     

  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-21-2006, 7:50 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    gillou01:

    what makes you say that? i have installed the latest build of the CTP that i could find on ajax web site

    well, the stack error you're getting:

    [InvalidOperationException: Script controls may not be registered before PreRender.]
    Microsoft.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +112
    Microsoft.Web.UI.ScriptManager.RegisterScriptControl(TScriptControl scriptControl) +100
    Microsoft.Web.Preview.UI.Controls.WebParts.WebPartManager.OnInit(EventArgs e) +148
    System.Web.UI.Control.InitRecursive(Control namingContainer) +460
    System.Web.UI.Control.InitRecursive(Control namingContainer) +272
    System.Web.UI.Control.InitRecursive(Control namingContainer) +272
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1745
    if you look at the value-added dll with reflector you'll be able to confirm that it doesn't override the OnInit method.

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-21-2006, 9:40 AM
    • Member
      20 point Member
    • rinando
    • Member since 11-13-2006, 10:48 AM
    • Posts 4

    Hi,

    Luis Abreu is right. I flushed my GAC and delete all copies of Microsoft.Web.Preview.dll's on my computer, restarted IIS, restarted Visual Studio and did a Build all.
    It works!

    Thanx!

    Greetz!

  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-22-2006, 3:04 AM
    • Participant
      831 point Participant
    • den2005
    • Member since 03-02-2006, 2:08 AM
    • Philippines
    • Posts 425

    Hi rinando,

      same problem, what do you meant by flushed your GAC of all copies of Microsoft.Web.Preview and all copies including in the application working on and in C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025?

    den2005

  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-22-2006, 10:30 AM
    • Member
      387 point Member
    • websolutions
    • Member since 01-27-2003, 10:22 AM
    • UK
    • Posts 80

    I have also come accross this issue and after lots of flushing and rebuilding I found that it actually was a coding issue losing prerender handlers.

    i've detailed it here: http://danielballa.blogspot.com/2006/11/script-controls-may-not-be-registered.html

     

    Cheers,
    Daniel
  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-22-2006, 11:30 AM
    • Member
      37 point Member
    • johnnyQuest
    • Member since 11-22-2006, 11:08 AM
    • Posts 10

    Hi All.

      I am getting the same type of error but it happens when using the UpdateProgress tag. I am using ASP.NET Ajax version 1.0.61025. I have the same versions installed on my local machine and on our company's dev box. When I run it on my local box, it works fine, when I publish to our dev box, it blows up with this error. After I remove the updateProgress tag it works fine. Can anyone offer a solution to this?

     

    Code causing the error:

     <asp:UpdatePanel ID="upnlVehiclePrice" runat="server" UpdateMode="conditional">
           <ContentTemplate>
                  <asp:UpdateProgress ID="uprVehiclePrice" runat="server" Visible="true" DisplayAfter="0" AssociatedUpdatePanelID="upnlVehicleSelection">
                          <ProgressTemplate>
                                  Retreiving Vehicle Price...</br>
                                  <asp:Image ID="imgRetrievingVehiclePrice" runat="server" ImageUrl="ajax-loader.gif" />
                          </ProgressTemplate>
                  </asp:UpdateProgress>
         </ContentTemplate>
    </asp:UpdatePanel>
          

     Error details/Stack Trace:

    Script controls may not be registered before PreRender.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Script controls may not be registered before PreRender.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

    Stack Trace:


    [InvalidOperationException: Script controls may not be registered before PreRender.]
       Microsoft.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +144
       Microsoft.Web.UI.ScriptManager.RegisterScriptControl(TScriptControl scriptControl) +114
       Microsoft.Web.Preview.UI.UpdateProgress.OnInit(EventArgs e) +122
       System.Web.UI.Control.InitRecursive(Control namingContainer) +321
       System.Web.UI.Control.InitRecursive(Control namingContainer) +198
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +2067711
       System.Web.UI.ControlCollection.Add(Control child) +146
       Microsoft.Web.UI.UpdatePanel.CreateContents(Boolean recreate) +291
       Microsoft.Web.UI.UpdatePanel.OnInit(EventArgs e) +101
       System.Web.UI.Control.InitRecursive(Control namingContainer) +321
       System.Web.UI.Control.InitRecursive(Control namingContainer) +198
       System.Web.UI.Control.InitRecursive(Control namingContainer) +198
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692
     

  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-22-2006, 11:37 AM
    • Member
      387 point Member
    • websolutions
    • Member since 01-27-2003, 10:22 AM
    • UK
    • Posts 80

    Check if the microsoft.web.extensions.dll version is the same. Check it in the bin directory of your application or GAC if it is gac-ed and in the temporary asp.net files.

    Also check if the web.config file is identical. 

    Cheers,
    Daniel
  • Re: Webpart Error - Script controls may not be registered before PreRender

    11-22-2006, 12:11 PM
    • Member
      37 point Member
    • johnnyQuest
    • Member since 11-22-2006, 11:08 AM
    • Posts 10

    Thanks for your help.

        I did check the dll, GAC, and the temp asp.net folder... all checked out fine which is even more perplexing. Nonetheless, I appreciate the suggestion.
     

Page 1 of 2 (20 items) 1 2 Next >