Re: add custom button to DNN instance?

  •  08-20-2009, 3:20 AM

    Re: add custom button to DNN instance?

    Hi ShadsTrains,
    How to add custom button to DNN instance?
     
    1. Open project 'Provider.sln'(you can find this project in download package 'Providers\HtmlEditorProviders\CEHtmlEditorProvider')
     
    2. Open file 'CEHtmlEditorProvider.vb' in the project above
     
    3. Find section below
    1. Protected Sub cntlCE_Load(ByVal sender As ObjectByVal e As EventArgs) Handles cntlCE.Load   
    2.             Try  
    3.                 AddDNNLinks()   
    4.             Catch ex As Exception   
    5.                 Throw New Exception("Check your provider configuration for errors!" & Environment.NewLine & ex.Message)   
    6.             End Try  
    7.         End Sub  

    Change to
    1. Protected Sub cntlCE_Load(ByVal sender As ObjectByVal e As EventArgs) Handles cntlCE.Load   
    2.            Try  
    3.                Dim tc As CuteEditor.ToolControl = cntlCE.ToolControls("insertcustombutonhere")   
    4.                Dim button1 As New System.Web.UI.HtmlControls.HtmlButton()   
    5.                button1.InnerText = "message"  
    6.                tc.Control.Controls.Add(button1)   
    7.                button1.Attributes("onclick") = "alert('hello')"  
    8.                tc.Control.Controls.Add(button1)   
    9.                AddDNNLinks()   
    10.            Catch ex As Exception   
    11.                Throw New Exception("Check your provider configuration for errors!" & Environment.NewLine & ex.Message)   
    12.            End Try  
    13.        End Sub  

    4. Build this project
     
    5. Use the new file 'DotNetNuke.CEHtmlEditorProvider.dll' to replace the old in the bin folder of your dnn site

    6.  When these done, you will see a button on the toolbar of the final
     
    Regards,
     
    Ken
View Complete Thread