views:

84

answers:

1

I am using TinyMCE in my ASP.net Web Forms CMS application on IIS7 and am having trouble in my content folders that are managed using the URL routing feature of .net 3.5sp1.

The root real default page of the application ("/default.aspx") works just fine; I have a custom toolbar and many settings defined for TinyMCE and it all works fantastically. My content route ("content/{PageIdentifier}" which maps to a content.aspx page in the root of the site at the same level as default.aspx) doesn't work very well. When the TinyMCE editor is invoked, it is in its default state -- my custom toolbar buttons and all of the custom settings (e.g. the stuff set in tinyMCE.init()) are ignored and it just comes up in default mode, as if no parameters were set (toolbar at bottom with few buttons).

I was thinking the editor can't find some or all of its js files that are in ~/static/js/tinymce since it's in a different folder level than what the route says it is (since, often if there's a JS error, this is how the editor appears). I tried moving content.aspx to a real /content/ folder, but that did nothing (at least relative addressing would work, then). I am at a loss.

A: 

I have one project I've worked on with ASP.NET MVC 1 where I had little access or privilege on the servers, so I can't say why things were like this, but on all of their servers using the root-relative paths (~/content/folder or /content/folder) failed, both in JavaScript and in server-side code.

The only workaround I found was to declare a variable in my master page and use it in all my JavaScripts to build absolute urls.

var _applicationPath = new String('<%= Request.ApplicationPath %>');

It was the only way I could get the web site to find files and pages when the depth of the URL changed - like default.aspx working, but not routed URLs.

HTH

Tim Rourke
The file itself renders just fine. The tinyMCE editor comes up, everything works, the only thing that's messed-up is the .init() call doesn't seem to work on my /content page, which is a Route-ed URL.
Robert C. Barth