Hi all
I'm new in the DNN - World so first of all a big hello to everyone ![](/Providers/HtmlEditorProviders/Fck/FCKeditor/editor/images/smiley/msn/regular_smile.gif)
I'm currently playing around with DNN 4.7. There I've modified the TreeViewMenu a little bit and the according dnn.controls.dnntree.js
So my next step would be to move that changes to an extra WebControl in order to restore the original functionality and use the new one in parallel in a second skin.
So far, so good, I've created my own TreeViewMenu it works but it still uses the modified dnn.controls.dnntree.js skript.
My question is: how to change that skript ?
My first approach was a dirty one which relies on the order of events.
In my WebControl, I override the OnPreRender() - event:
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
MyBase.OnPreRender(e)
If Not ClientAPI.IsClientScriptBlockRegistered(Me.Page, "dummy.js") Then
ClientAPI.RegisterClientScriptBlock(Me.Page, "dummy.js", _
"<script src = ""/DnnTest/mpro/Controls/JS/dummy.js""></script>")
End If
ClientAPI.RegisterStartUpScript(Me.Page, Me.Control.NavigationControl.ClientID & "_startup", _
"<script>startDummy($('" & Me.Control.NavigationControl.ClientID & "'))</script>")
End Sub
This solution works but only because of:
- The underlying ClientScriptManager of the .Net Framework registers the StartupScript for a key only once - any further registrations seems to be ignored
- The PreRender() of the Control seems to be called before the PreRender of the underlying DnnTree
My second approach would be to write an own NavigationProvider (merely a copy of DnnTreeNavigationProvider), derive an own Tree from DnnTree, register my scripts there, instantiate the derived tree in my NavigationProvider and use this one.
But at the end this also burns down to override a PreRender() method, but now I override a method where I don't know what the base class does, because the DnnTree is delivered only in a .dll without sources.
So my question here is: what does the DnnTree.OnPreRender() additionally to registering the scripts ? do I have to call MyBase.OnPreRender() in my derived tree or can I savely ignore the MyBase.OnPreRender() then ?
Or am I totally wrong and there's a much simplier solution for that ?
Thanx in Advance and greetings
Bernd