How to create CuteEditor Dynamically in VB

Last post 06-16-2006, 6:59 AM by aonh2000. 2 replies.
Sort Posts: Previous Next
  •  06-14-2006, 12:25 PM 20137

    How to create CuteEditor Dynamically in VB

    Hello,
     
    I have asked this earlier as well.
     
    I am having problems trying to create the CuteEditor.Net control in my vb file. This is what I am trying to do in my vb code of ASP.NET page

    Dim
    Editor1 As New CuteEditor.Editor
    Editor.id =
    "txtProcedure"
    Me.Controls.Add(Editor)
     
    When I try to do this it give me the following error
     
    "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."
     
    Please tell me if this is the right way of adding a CuteEditor.Net control to an ASP page, I have checked the datagrid example in your example files. But that example is only assgining a variable to a already created CuteEditor.Net control on the aspx page.
     
     
    What I want to do is create the control in my vb code without creating it in aspx page, just like editor.draw() function used to do in previous asp version of CuteEditor.
     
    Please help
     
    Thanks
     
    Aon
     
     
  •  06-14-2006, 1:36 PM 20141 in reply to 20137

    Re: How to create CuteEditor Dynamically in VB

    Aon,
     
    The above code looks ok.
     
    Please post the code of your whole page.
     
     

    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

  •  06-16-2006, 6:59 AM 20211 in reply to 20141

    Re: How to create CuteEditor Dynamically in VB

    I have simplified the code to the point where its only giving the error
     
    "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."

     
    Please take a look and let me know if there is a better way of accomplishing the same result. I want to add a new CuteEditor at a certain place on my page dynamically.
     
    <%  '**************************************************************************************** %>
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
    <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
    <div>
        Before The Editor
    </div>
    <div>
    <%
        Dim Editor As New CuteEditor.Editor
        Editor.ID = "txtEditor"
        Editor.FilesPath = "../CuteSoft_Client/CuteEditor"
        Me.Controls.Add(Editor)
    %>
    </div>
    <div>
        After the Editor
    </div>
    </body>
    </html>
    <%  '**************************************************************************************** %>
     
     
    Thanks
     
    Aon
     
View as RSS news feed in XML