creating a CuteEditor object programmatically in VB.NET code-behind file

Last post 08-24-2007, 12:00 PM by MohammedL. 5 replies.
Sort Posts: Previous Next
  •  08-24-2007, 10:12 AM 32842

    creating a CuteEditor object programmatically in VB.NET code-behind file

    Hello All,
     
    I am trying to create a CuteEditor object in my code-behind file...but for some weird reason, I am unable to do so!  Can someone please shed some light on this.  Thank you for your time and assistance.
     
    Regards,
    Mohammed
  •  08-24-2007, 10:21 AM 32843 in reply to 32842

    Re: creating a CuteEditor object programmatically in VB.NET code-behind file

  •  08-24-2007, 10:33 AM 32844 in reply to 32843

    Re: creating a CuteEditor object programmatically in VB.NET code-behind file

    Hello Adam!
     
    Thank you for your prompt assistance!  If you don't mind me requesting, could you kindly share the code in your ButtonClick Event?
     
     
    Thanks,
    Mohammed
     
  •  08-24-2007, 10:35 AM 32846 in reply to 32844

    Re: creating a CuteEditor object programmatically in VB.NET code-behind file

    are you using some sort of loop structure?
     
     
    thanks,
    mohammed
     
     
     
  •  08-24-2007, 10:36 AM 32847 in reply to 32844

    Re: creating a CuteEditor object programmatically in VB.NET code-behind file

    Code is here:
     

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor"%>
    <%@ Page Language="vb" ValidateRequest="False"%>
     <HEAD>
      <title>ASP and ASP.NET WYSIWYG Editor - Default Configuration </title>
      <link rel="stylesheet" href="example.css" type="text/css">  
     </HEAD>
     <body>
      <form runat="server">
       <h4>How many Editors would you like to create? (<i>Please choose vaule between 1 and 10</i>)</h4>
       <hr>
       <asp:textbox runat="Server" id="txtTBCount" Columns="3" />
       <asp:RangeValidator runat="server" ControlToValidate="txtTBCount"
         MinimumValue="1" MaximumValue="10" Type="Integer"
         ErrorMessage="Make sure that you choose a value between 1 and 10!" ID="Rangevalidator1" NAME="Rangevalidator1"/>
       <br />
       <asp:button runat="server" Text="Create Dynamic Editors" OnClick="CreateEditors" ID="Button1" NAME="Button1"/>
       <p>
        <asp:PlaceHolder runat="server" id="EditorsHere" />
       </p>

      </form>
      <script runat="server">
      
       Dim count As Integer =  1
     
       Private  Sub IterateThroughChildren(ByVal parent As Control)
        Dim c As Control
        For Each c In parent.Controls
         If c.GetType().ToString().Equals("CuteEditor.Editor") Then
              Dim edit As CuteEditor.Editor
          edit = CType(c, CuteEditor.Editor)
          edit.Text =  "Editor " + count.ToString()
          edit.AutoConfigure =  AutoConfigure.Simple
          edit.Height =  System.Web.UI.WebControls.Unit.Parse(200)
          edit.ThemeType =  ThemeType.Office2003_BlueTheme
     
          count = count + 1
         End If
     
         If c.Controls.Count > 0 Then
          IterateThroughChildren(c)
         End If
        Next
       End Sub
     
       Private  Sub CreateEditors(ByVal sender As Object, ByVal e As EventArgs)
        If Not Page.IsValid Then
          Return
        End If
     
        Dim n As Integer =  Int32.Parse(txtTBCount.Text)
     
        ' now, create n Editors, adding them to the PlaceHolder EditorsHere
        Dim i As Integer
        For  i = 0 To  n- 1  Step  i + 1
         EditorsHere.Controls.Add(New CuteEditor.Editor())
        Next
     
        ' now, set the Text property of each CuteEditor.Editor
        IterateThroughChildren(Me)
       End Sub

      </script>
     </body>
    </HTML>


    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

  •  08-24-2007, 12:00 PM 32857 in reply to 32847

    Re: creating a CuteEditor object programmatically in VB.NET code-behind file

    Thanks a mnillion, Adam!  It is much appreciated!
     
     
    Regards,
    Mohammed
     
View as RSS news feed in XML