locked
When I working with Ajax File Upload , getting exception RRS feed

  • Question

  • User-930371450 posted

    When I working with Ajax File Upload , getting exception

    Please help me

    The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

    Server Error in '/' Application.
    
    Only one instance of a ScriptManager can be added to the page.
    
    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: Only one instance of a ScriptManager can be added to the page.
    
    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: Only one instance of a ScriptManager can be added to the page.]
       System.Web.UI.ScriptManager.OnInit(EventArgs e) +535
       System.Web.UI.Control.InitRecursive(Control namingContainer) +134
       System.Web.UI.Control.InitRecursive(Control namingContainer) +290
       System.Web.UI.Control.InitRecursive(Control namingContainer) +290
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +489
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

    Thursday, June 12, 2014 6:37 AM

Answers

  • User1918509225 posted

    Hi SSK_Nani,

    According to your post, you may add Asp ScriptManager and AjaxCotrol ToolkitScriptManger

    at the same time in your page.

    I suggest that you remove the Asp ScriptManager ,make sure that you just have one script manager in your page.

     

     

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 13, 2014 2:37 AM

All replies

  • User-802546231 posted

    This error indicates you have more than one ScriptManage on the page

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

    Thursday, June 12, 2014 6:40 AM
  • User-930371450 posted

    Hi,

    I have added same thing but getting same exception

    Thursday, June 12, 2014 6:48 AM
  • User-802546231 posted

    You need to remove any extra ScriptManagers, you should only have one

    Thursday, June 12, 2014 6:59 AM
  • User-1716253493 posted
    Place script manager at top of the page, use single script manager only. If you already have it in master page. Remove it from the content page.
    Thursday, June 12, 2014 7:09 AM
  • User-930371450 posted

    Hi ONed,

    Eventhough getting same error.

    Thursday, June 12, 2014 8:23 AM
  • User2103319870 posted

    Have your added both AjaxControl ToolkitScriptManager and asp ScriptManager to your page. Then Please remove one ( I would remove the asp scriptmanager and keep AjaxControlToolkit ScriprManger) and ensure that you have only one script manager in your application.

    Thursday, June 12, 2014 8:39 AM
  • User465171450 posted

    Are you using a script manager in a masterpage? If so, make sure your .aspx page, and any user controls on this page don't have a script manager. If so, you will get the duplicate error.

    Now, the controls collection error is completely different than what the application error code block is showing.  Telerik has a product called RadCodeBlock to help with this. I haven't found others yet.

    Here is a bit of an explenation of why it happens.

    http://weblog.west-wind.com/posts/2006/Jun/24/Understanding-how-expressions-render-and-why-ControlsAdd-doesnt-work

    One possible solution:

    http://weblogs.asp.net/infinitiesloop/The-CodeExpressionBuilder

    Thursday, June 12, 2014 9:21 AM
  • User1918509225 posted

    Hi SSK_Nani,

    According to your post, you may add Asp ScriptManager and AjaxCotrol ToolkitScriptManger

    at the same time in your page.

    I suggest that you remove the Asp ScriptManager ,make sure that you just have one script manager in your page.

     

     

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 13, 2014 2:37 AM