add custom button to DNN instance?

Last post 08-20-2009, 3:20 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  08-20-2009, 1:43 AM 54840

    add custom button to DNN instance?

    Is it possible to add a custom button to a DNN instance?  What I'm after is to have a dialog box pop up, ask for an image url and then wrap that url in the html necessary to display the image.  I've dug through the documentation and i'm a little confused as to how I'd do it..  What I want is similar to this example..
     
    http://www.cutesoft.net/example/howto/AddDialogs/vb/create_a_custom_dialog.aspx
     
     
  •  08-20-2009, 3:20 AM 54842 in reply to 54840

    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 as RSS news feed in XML