locked
Getting sys.InvalidOperation using ajax control toolkit HTMLEditor control RRS feed

  • Question

  • User1299702196 posted

    Hello,

    I've seen similar posts, usually concerning the tabcontrol in the toolkit. I've tried the solution offered to no avail. I found this thread but didn't work for me:

    http://forums.asp.net/t/1421360.aspx?Sys+InvalidOperationException+Component+not+found+IE7

    I'm using VS 2010, framework version 3.5 along with 3.5 version of AjaxControltoolkit. In debugging, I can access the control in code behind but then the java script error is raised.

    Additional info: I'm using an ajax call to populate a div container and pop it up within another page. The ajax call is working fine but the javascript error is raised.

    My html looks like this:

    <%@ Register Namespace="MyControls" TagPrefix="mc" %>
    
    
    <mc:HtmEditor runat="server" ID="txtPDDesc" Height="75px" Width="98%" EnableViewState="true" />
    
    MyControls looks like this:
    
    Imports Microsoft.VisualBasic
    Imports AjaxControlToolkit.HTMLEditor
    
    Namespace MyControls
       Public Class HtmEditor
          Inherits Editor
    
          Public Sub New()
             MyBase.New()
          End Sub
    
          Protected Overrides Sub FillTopToolbar()
             TopToolbar.Buttons.Add(New AjaxControlToolkit.HTMLEditor.ToolbarButton.FontSize())
             TopToolbar.Buttons.Add(New AjaxControlToolkit.HTMLEditor.ToolbarButton.BulletedList())
             TopToolbar.Buttons.Add(New AjaxControlToolkit.HTMLEditor.ToolbarButton.Bold())
             TopToolbar.Buttons.Add(New AjaxControlToolkit.HTMLEditor.ToolbarButton.Underline())
             TopToolbar.Buttons.Add(New AjaxControlToolkit.HTMLEditor.ToolbarButton.Italic())
          End Sub
    
          Protected Overrides Sub FillBottomToolbar()
             BottomToolbar.Buttons.Add(New AjaxControlToolkit.HTMLEditor.ToolbarButton.DesignMode())
             BottomToolbar.Buttons.Add(New AjaxControlToolkit.HTMLEditor.ToolbarButton.PreviewMode())
          End Sub
       End Class
    End Namespace

    Can anyone help me resolve this error?

    Wednesday, March 2, 2016 8:58 PM

Answers

  • User61956409 posted

    Hi SALong,

    JavaScript runtime error: Sys.InvalidOperationException: Component 'txtPDDesc_ctl02' was not found

    Please try to append the following property to your control and test it again.

    ClientIDMode="Static"

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 10, 2016 6:20 AM

All replies

  • User61956409 posted

    Hi SALong,

    I'm using VS 2010, framework version 3.5 along with 3.5 version of AjaxControltoolkit. In debugging, I can access the control in code behind but then the java script error is raised.

    Additional info: I'm using an ajax call to populate a div container and pop it up within another page. The ajax call is working fine but the javascript error is raised.

    Could you share us more error message? Besides, you could try to uninstall and reinstall Ajax Control Toolkit and test again.

    Best Regards,

    Fei Han

    Thursday, March 3, 2016 2:17 AM
  • User1299702196 posted
    Hello Fei Han,
    Here is the entire error message that pops up in a dialog in debug mode:
    JavaScript runtime error: Sys.InvalidOperationException: Component 'txtPDDesc_ctl02' was not found

    Of course the _ctl02 is the decoration that is applied to the control by asp to ensure unique control names.
    I have not yet tried to uninstall and re-install but I can.
    Friday, March 4, 2016 7:56 PM
  • User1299702196 posted
    Also, I uninstalled and reinstalled the AjaxcontrolToolKit using the follow method:
    to uninstall:
    Removed the AjaxControlToolkit tab from the Controls Toolbox.
    Removed the project's reference to the AjaxControlToolkit
    Removed related folders in the project's bin folder.

    To reinstall:
    Added the AjaxControlToolkit tab to the toolbox
    Added items to the tab using the browse method and browsed to a download I had and it installed the AjaxControlToolkit tools in the tab.

    The project was referencing file version: 3.5.40412.2
    The reinstall is now referencing file version 3.5.7.1213

    The exact same problem persists. I am at my wits end. Any help on this?
    Friday, March 4, 2016 10:17 PM
  • User61956409 posted

    Hi SALong,

    JavaScript runtime error: Sys.InvalidOperationException: Component 'txtPDDesc_ctl02' was not found

    Please try to append the following property to your control and test it again.

    ClientIDMode="Static"

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 10, 2016 6:20 AM