Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...how to use another .js than dnn.controls.dnntree.js  for the TreeViewMenu ?how to use another .js than dnn.controls.dnntree.js for the TreeViewMenu ?
Previous
 
Next
New Post
12/12/2007 6:11 AM
 

Hi all

I'm new in the DNN - World so first of all a big hello to everyone

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

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...how to use another .js than dnn.controls.dnntree.js  for the TreeViewMenu ?how to use another .js than dnn.controls.dnntree.js for the TreeViewMenu ?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out