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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIDotNetNuke 5. 0 Issue - Error: DotNetNuke 5. 0 Issue - Error: 'dnn.controls.toolbars' is null or not an object
Previous
 
Next
New Post
9/4/2009 11:20 AM
 

James, can you confirm what you mean by removing the DNNNav from the page specifically? A container/skin/component? We have been trying to track this one down for a while so I am very curious. Basics are... if you went to dotnetnuke.com and clicked 'view source' within the page you would see that dnn.controls.js gets rendered to the page. But for some customers/specific situations it only gets rendered when the page is in 'edit' mode.

 

Other potential work arounds were to use a module such as a Script Injector to manually force that file to exist/get rendered etc...

-Chad

 

 
New Post
9/28/2009 2:55 PM
 

Ok... I found the culprit here and very happy to know what is actually going on! Ill probably report this as a bug in Gemini soon.

Here is what is happening... A newer version of the dotnetnuke.webcontrols was released when DNN 5.x was released and this included new code for only rendering certain JavaScript files such as dnn.controls.js or many of the others such as the dnnmenu and so forth ONLY when a module uses a specific control. This is great but for the purpuses of the DNN Toolbar and so forth it wasn't always accurate. 

Here is the bug:

1. Add into a module just the DNN Toolbar and DNN Label Edit

2. If no other modules or anything on the page loads, and the page is in view only mode, it will not (at least in several cases) render the dnn.controls.js file because it doesn't think it needs to. But... even if the toolbar/dnn label edit control isn't visible it still renders some code to the page. For example:

This is rendered to the page...
dnn.controls.toolbars['tbDynamicF']={btns:[{key:'edit',alt:'Edit',css:'eipbutton_edit',ca:'edit'},{key:'save',alt:'Update',css:'eipbutton_save',ca:'save'},{key:'cancel',alt:'Cancel',ca:'cancel'}],vis:-1,cssbh:'eipborderhover',css:'eipbackimg',cssb:'eipbuttonbackimg'};


So when this is rendered to the page and dnn.controls.js isn't then the user is given a JavaScript error. 

This is because of this line of code in the DNNLabelEdit.vb file (similar in the toolbar file I think):

	If IsDownLevel = False AndAlso Me.EditEnabled Then
				DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(Me.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn_dom)
                'DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(Me.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn_xml)
				DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(Me.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn_dom_positioning)
				DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(Me.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn_xmlhttp)

                'If Not ClientAPI.IsClientScriptBlockRegistered(Me.Page, "dnn.controls.dnnlabeledit.js") Then
                '	ClientAPI.RegisterClientScriptBlock(Me.Page, "dnn.controls.dnnlabeledit.js", "<script src=""" & LabelEditScriptPath & "dnn.controls.dnnlabeledit.js""></script>")
                'End If
                RegisterClientScriptBlock(Me.Page, "dnn.controls.js")
                RegisterClientScriptBlock(Me.Page, "dnn.controls.dnnlabeledit.js")
                If ClientAPI.UseExternalScripts = False Then
                    ClientAPI.RegisterEmbeddedResource(Me.Page, "dnn.controls.dnninputtext.js", Me.GetType())
                    ClientAPI.RegisterEmbeddedResource(Me.Page, "dnn.controls.dnnrichtext.js", Me.GetType())
                End If

				'ClientAPI.RegisterStartUpScript(Page, Me.ClientID & "_startup", "<script type="text/javascript">dnn.controls.initLabelEdit(dnn.dom.getById('" & Me.ClientID & "'));</script>")				   'wrong place
			End If

So basically if you are NOT in edit mode then the dnn.controls.js file is never rendered. But... it does render JavaScript back whcih throws the error.

The work wround? The work round us to include another control that is not used in the module, just so DNN will know to render the dnn.controls.js file.  So for example, including this in the ASCX file will make sure to render that.
<code><DNN:DNNMenu Id="myDNNMenu" RunAt="Server" Orientation="Horizontal"></DNN:DNNMenu></code>

Which really shouldn't be needed because the control isn't used. 

-Chad

 

 

 

 
New Post
12/15/2009 7:46 PM
 

I have been having this same issue for some time and I have tried every post on this thread but am still having this issue.

I have used the Script Injector Module with:
<script src="/js/dnn.controls.js" type="text/javascript"></script>
<script src="/js/dnn.controls.dnntoolbar.js" type="text/javascript"></script>
<script src="/js/dnn.controls.toolbar.js" type="text/javascript"></script>
<script src="/js/dnn.controls.dnnmenu.js" type="text/javascript"></script>
And
<code><DNN:DNNMenu Id="myDNNMenu" RunAt="Server" Orientation="Horizontal"></DNN:DNNMenu></code>
Has anyone found a solution?
 
New Post
12/15/2009 7:49 PM
 

I have been having this same issue for some time and I have tried every post on this thread but am still having this issue.

I have used the Script Injector Module with:
<script src="/js/dnn.controls.js" type="text/javascript"></script>
<script src="/js/dnn.controls.dnntoolbar.js" type="text/javascript"></script>
<script src="/js/dnn.controls.toolbar.js" type="text/javascript"></script>
<script src="/js/dnn.controls.dnnmenu.js" type="text/javascript"></script>
And
<code><DNN:DNNMenu Id="myDNNMenu" RunAt="Server" Orientation="Horizontal"></DNN:DNNMenu></code>
Has anyone found a solution?
 
New Post
1/29/2010 1:22 PM
 
Anybody have a work around? IS this issue resolved in the new version of DNN5? Thanks!
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIDotNetNuke 5. 0 Issue - Error: DotNetNuke 5. 0 Issue - Error: 'dnn.controls.toolbars' is null or not an object


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