Registered Custom button in .config file

Last post 03-07-2006, 9:38 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  03-07-2006, 12:45 PM 16802

    Registered Custom button in .config file

    i am haveing problems with registering a custom button and then putting the button in the .config file. 
     
    The button works with the templateitemlist but for reuseablity purposes I would like to put it in the .config file useing configurationpath. 
     
    here is the html

     <P><CE:EDITOR id="Editor1" runat="server" Height="384px" EditorWysiwygModeCss="../example.css"
                                                    configurationPath="C:\Inetpub\wwwroot\WebApplication2\myconfig.config"  Width="890px"></CE:EDITOR></P>
                                        <P>&nbsp;</P>

     

    Here is the excerpt from the .config file

     
    <item type="holder" name="btnadd" />
     
    Here is the excerpt from the vb code

    Private Sub Editor1_Initializing(ByVal sender As System.Object, ByVal e As System.EventArgs)

    If Not Page.IsPostBack Then

    Editor1.Text = "Type Here"

    End If

    Dim btnadd As New System.Web.UI.WebControls.Button

    btnadd.Text = "btnadd"

    btnadd.Style("vertical-align") = "middle"

    btnadd.CommandName = "btnadd"

    AddHandler btnAdd.Click, AddressOf btnAdd_Click

    Editor1.RegisterCustomButton("btnadd", btnadd)

    End Sub
     
    Does any body know how to get this to work
  •  03-07-2006, 9:38 PM 16825 in reply to 16802

    Re: Registered Custom button in .config file

    jon1b,
     
    Try the following modified code:
     
    Private Sub Editor1_Initializing(ByVal sender As System.Object, ByVal e As System.EventArgs)
        If Not Page.IsPostBack Then
            Editor1.Text = "Type Here"
        End If
     
        Dim btnadd As New System.Web.UI.WebControls.Button
        btnadd.Text = "btnadd"
        btnadd.Style("vertical-align") = "middle"
        btnadd.CommandName = "btnadd"
        AddHandler btnAdd.Click, AddressOf btnAdd_Click
        Editor1.RegisterCustomButton("btnadd", btnadd)
     
        
        Dim container As System.Web.UI.Control
        container = Editor2.ToolControls("btnadd").Control
     
        container.Controls.Add(btnadd )              
     
    End Sub
     
     

    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