Re: Custom Button for linking to internal pages

  •  03-30-2005, 11:21 PM

    Re: Custom Button for linking to internal pages

    Andrew,


    Step 1.    Locate and open CEHtmlEditorProvider.vb, Find Public Sub New() 

    Step 2.   
          .......

          cntlCE.DisableItemList = "Save".
        
         If Not cntlCE.ToolControls("insertcustombutonhere") Is Nothing Then

                    Dim container As System.Web.UI.Control
                    container = Editor2.ToolControls("insertcustombutonhere").Control
                    Dim dropdown As CuteEditor.RichDropDownList
                    dropdown = New CuteEditor.RichDropDownList(Editor2)
                    dropdown.Attributes("onchange") = "CuteEditor_DropDownCommand(this,'InsertLink')"
                    'must set this css name
                    dropdown.CssClass = "CuteEditorDropDown"
                    'add the first item (caption)
                    'the culture-text would be auto replaced..
                    dropdown.Items.Add("[[Links]]", "")
                    'hide the first item (caption) in the float-panel
                    dropdown.RichHideFirstItem = True
                    'add the items here every times
                    dropdown.Items.Add("http://www.asp.net/")
                    'add - !!!
                    'if the statements put before Controls.Add , the statements must be executed every time
                    container.Controls.Add(dropdown)
                    'if the statements put after Controls.Add the statements could be executed only the first time
                    'or add items here if(!IsPostBack)
                    If Not Page.IsPostBack Then
                        dropdown.Items.Add("Microsoft", "http://www.microsoft.com/")
                        dropdown.Items.Add("<font color=red>CuteSoft</font>", "*CuteSoft*", "http://www.cutesoft.net/")
                    End If
        End If

    Step 3.  Recompile the project.



    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 Complete Thread