I've implemented CAPTCHA for a form submission page in my app as per code I got from Pro ASP.NET MVC Framework book.
He has a Tip in there that says "if you want to turn this into a reusable, distributable CAPTCHA component... all you have to do is to put the CaptchaHelper and CaptchaImageController classes into a stand-alone assembly."
What does this mean?
I was thinking that I'd just create a new MVC project, have this single controller in the controller folder, and the helper file in the Helper folder. It compiles just fine.
I then include that project into my solution and have added references to this project in both of my other sub-projects (one for business layer, other for ui).
But when I try to render the page, the view cannot render the captcha image. (btw, it worked just fine before I broke it out into a separate project.)
The view page can't seem to find the CAPTCHA controller.
I guess I need help in creating a stand-alone controller...
Thanks, Scott
Error is:
Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service Captcha.CaptchaImageController was found at Castle.MicroKernel.DefaultKernel.get_Item(Type service) at Castle.Windsor.WindsorContainer.Resolve(Type service) at WebUI.WindsorControllerFactory.GetControllerInstance(Type controllerType) in
C:\work_aspx\PostHealthWellness\WebUI\WindsorControllerFactory.cs:line 48 at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) at System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)