Error Message with CE5 in .NET

Last post 11-01-2005, 5:25 PM by Adam. 4 replies.
Sort Posts: Previous Next
  •  10-19-2005, 4:19 PM 11858

    Error Message with CE5 in .NET

    Hey,
     
    I have copied the new CuteSoft v5 over my old version and I am now getting an error. This code worked with the version 4.x version I had before. I have removed the editor from the pages and added it back. Any one have any ideas on why this code doesn't work with the CE5?
    >>>>
    Object reference not set to an instance of an object.
    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.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Line 142:// BEGIN Get Links for Links Drop Down
    Line 143:CuteEditor.ToolControl toolctrl=Editor1.ToolControls["Links"];
    Line 144:CuteEditor.RichDropDownList rddl=(CuteEditor.RichDropDownList)toolctrl.Control;
    <<<<
    Thanks,
     
    Paul
  •  10-25-2005, 12:06 PM 11997 in reply to 11858

    Re: Error Message with CE5 in .NET

    Does anyone have any idea why this is happening? I have sent emails to Support and as you see posted here, but I have gotten no response from CuteSoft...
     
    Thanks,
     
    Paul
  •  10-25-2005, 12:15 PM 11998 in reply to 11997

    Re: Error Message with CE5 in .NET

    Paul,
     
    Please try the following code:
     
        //see the AutoConfigure/Full.config
        //<item type="dropdown" name="Links" RenderItemBorder="true" text="[[Links]]" command="InsertLink" />
        if(Editor1.ToolControls["Links"]!=null)
        {
         CuteEditor.RichDropDownList dropdown=(CuteEditor.RichDropDownList)Editor1.ToolControls["Links"].Control;
             
         //the first item is just the caption
         CuteEditor.RichListItem richitem=dropdown.Items[0];
         //clear the items from configuration files
         //see Configuration/Shared/Common.config

         dropdown.Items.Clear();
         //add the caption - Links
         dropdown.Items.Add(richitem);
         //value only
         dropdown.Items.Add("http://www.asp.net/");
         //text and value
         dropdown.Items.Add("Microsoft","http://www.microsoft.com/");
         //html and text and value
         dropdown.Items.Add("<font color=red>CuteSoft</font>","*CuteSoft*","http://www.cutesoft.net/");
        }
     
    Hope it helps.
     
    Let me know if you have any further questions.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-31-2005, 5:07 PM 12140 in reply to 11998

    Re: Error Message with CE5 in .NET

    Adam,
     
    It is compiling now, but it always skips the code because the Editor1.ToolControls["Links"]!=null statement is always true. I changed it a bit ..

    // BEGIN Get Links for Links Drop Down

    CuteEditor.ToolControl toolctrl=Editor1.ToolControls["Links"];

    if(toolctrl !=null)

    {

    CuteEditor.RichDropDownList dropdown=(CuteEditor.RichDropDownList)Editor1.ToolControls["Links"].Control;

     //the first item is just the caption

     CuteEditor.RichListItem richitem=dropdown.Items[0];

    //clear the items from configuration files

    //see Configuration/Shared/Common.config

    dropdown.Items.Clear();

    //add the caption - Links

    dropdown.Items.Add(richitem);

    //text and value

    dropdown.Items.Add("Nascar","http://www.nascar.com/");

    //html and text and value

    dropdown.Items.Add("<font color=red>CuteSoft.NET</font>","*CuteSoft*",http://www.cutesoft.net/);

    }

    else

     {

    lblMessage.Text = "null";

    lblMessage.Visible = true;

    }

     

    // END Get Links for Links Drop Down

    and it always outputs null in the lblMessage and does not show the links hardcoded. 
    I checked in the full.config and have tested itboth with the
      <item type="dropdown" name="Links" RenderItemBorder="true" text="[[Links]]" command="InsertLink" />
    commented out and not commented out and it makes no difference.

    It is probably something stupid I am missing but I would appreciate your help.

    Thanks,

    Paul 
  •  11-01-2005, 5:25 PM 12169 in reply to 12140

    Re: Error Message with CE5 in .NET

    Paul,
     
    In the version 5.0, the Link of RichDropDownList has been changed to the TreeDropDownList.

    Please use the following code instead:    
     
       //Get the TreeDropDownList
       //check <item type="treedropdown" name="LinkTree" text="[[Links]]" width="50" command="InsertLink" />
       //check Common.config

       CuteEditor.ToolControl tc = Editor1.ToolControls["LinkTree"];
       CuteEditor.TreeDropDownList tdd = (CuteEditor.TreeDropDownList) tc.Control;   
       
       //clear the items from configuration files
       //see Configuration/Shared/Common.config
       //tdd.Items.Clear();

         
       //Add items by code
       CuteEditor.TreeListItem rootitem=new CuteEditor.TreeListItem("Root",null);
       rootitem.Selectable=false;
       tdd.Items.Add(rootitem);
       rootitem.Items.Add("Asp<font color=red>.Net</font>","Asp.Net","http://asp.net");
       rootitem.Items.Add("DotNetNuke.Net","DotNetNuke.Net","http://DotNetNuke.com");
       rootitem.Items.Add("CuteSoft","CuteSoft","http://CuteSoft.net");

    You can get the full source code of this example in the download package.

    The example is under advanced topics:

    How to dynamically populate the tree view dropdown menu?

    Keep me posted.


     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML