views:

61

answers:

2

Hello SO,

I am trying to implement the TinyMCE Spellcheck plugin that uses GoogleSpell. The thing is I am trying to install it in an MVC environment.

I started by referencing the .NET class Library DLL (MoxieCode.TinyMCE) in my project.

Then, I added this code to my web.config:

<system.webServer>
    <handlers>
      <add name="TinyMCE" verb="GET,HEAD,POST" path="TinyMCE.ashx" type="Moxiecode.TinyMCE.Web.HttpHandler,Moxiecode.TinyMCE" />
    </handlers>
    <!--previously existing rules-->
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

I then added these lines to my tinyMCE.init({}); call:

        plugins: "spellchecker",
        theme_advanced_buttons3: "spellchecker",
        spellchecker_languages : "English=en",
        spellchecker_rpc_url : "TinyMCE.ashx?module=SpellChecker",

These steps are outlined in the tutorial here. I then followed instructions from this stack overflow post which recommended the following modification to global.asax to make it mvc friendly:

        routes.IgnoreRoute("TinyMCE.ashx"); 
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

Everything seems fine accept that when I browse to /TinyMCE.ashx i get this error:

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /TinyMCE.ashx

Why can't asp.net mvc process that url?

+1  A: 

Make sure the handler is being applied at the correct element in the web.config.

IIS supports 2 types of modes, an integrated mode and a classic mode.

The classic mode is the how versions previous to IIS 7 worked. Depending on that, you put the handlers in the web.config section that applies to asp.net, or in the section that is picked by IIS directly.

eglasius
A: 

After a fair bit of frustration I stopped messing with it on localhost in VS 2010. I suspected that it was a problem relating to IIS configuration, so I uploaded the site to a sub-domain of the live server. It worked without any problem.

I'm not sure why the code didn't work on localhost but evidently, the steps I followed to execute TinyMCE .NET and GoogleSpell were correct because they work on the live server.

quakkels