Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts

Friday, January 10, 2014

DNN Edit Page and Menu Not Working

 

After upgrading to DNN 7.2.0 the Edit Page button and the Admin Menu did not work. A quick check with Fiddler discovered that the JQuery scripts did not load

  • .../resources/libraries/jquery/1.9.1/jquery.js?cdv=236
  • .../resources/libraries/jquery-ui/1.10.3/jquery-ui.js?cdv=236
  • .../resources/libraries/jquery-migrate/1.2.1/jquery-migrate.js?cdv=236

Checked the existence of the files in the DNN Web directory on the IIS Server, all files were present.

The next check was the IIS log files, and here the solution was discovered:

GET /Rejected-By-UrlScan ~/resources/libraries/jquery-ui/1.10.3/jquery-ui.js?cdv=236

The IIS UrlScan rejected all paths that included a ‘dot’ in the pathname.

Note: The UrlScan.ini should be updated with caution, in this case the solution was to set AllowDotInPath=1  and to make sure that the double dots, dot slash and dot backslash also was rejected. By enabling dots in path names the PATH_INFO variable can be interpreted wrong. The rule of thumb is that if AllowDotInPath=1 is set, then rules based on the file extension may do unexpected things, including allowing requests that you intend to block .

Consider the url libraries/jquery/1.9.1/jquery.js

This can be converted into file = 1.9.1 parameter is /jquery.js

Or Download/Files.new/test.doc

Can be translated to

Get files.new with parameter test.doc

For versioning paths I always use hyphen or underscore

Friday, July 31, 2009

Tweaking the Quicklaunch menu with JQuery

The standard Quicklaunch menu or the <SharePoint:AspMenu> has some limitations regarding layout and dynamic display… Microsoft has released the code to the menu in order to make the menu more customizable (The reason for the publication of the source code is the the fact that the control is marked as sealed and is therefore not eligible to be used as the base class for derived types.) Read my other post on how to use this code to highlight the selected menu items.

When using a WSS environment the menu has further limitations regarding the url of a root element. The “problem” is that all menu items must have a url. The easy fix for this is to make all your level one URL’s like “/#” This will result in a link to the same page, but there will be a postback when a user clicks on the link.

In some scenarios you do not want, or you can not modify SharePoint using Features and compiled code.

So how do we modify the menu without writing any C# code? We use the JQuery library to parse and tweak the HTML already generated by the aspmenu control

The main part of the JQuery code is made by Paul Grenier and filed at EnduserSharePoint.com. Be sure to check out the other JQuery and SharePoint related articles!

The solution looks like this when finished

JQuery_Menu

To make the menu look like this I used one JavaScript library, a modified CSS file and a modified Masterpage. The masterpage modifications is minor and not a part of the dynamic experience…

The masterpage was modified to link to the two java libraries used, one for the JQuery library and one for the script from Paul Grenier.

linking_JQuery

I have modified the script a little in order to make the empty headers act as you clicked on +/- (The modifications are simple and can surely be made better, but it is my first JQuery Code)

JQueryMod

When a link is modified in SharePoint Services and the address is /#! the link will not behave like a normal link but expand/collapse instead.

jquery_empty_link

This was a big eye opener and definitely my start down the “JQuery Lane” It is so much you can do with so little code…

The files used can be downloaded here