
Ideally I would like to extend my set of MVC3 HtmlHelper extension methods with a CaptchaFor() method so I can write => m.CaptchaText) in my view, or something similar. I've tried all manner of methods to retrieve the captcha object, including passing the model through to the view and controller, but it seems to lose context and create a new instance of my object every time I click submit. I've added a TextBox called CaptchaText to capture the text input from the user. I need to be able to store the generated Captcha string and check a user's TextBox input against it.įor my page model, I'm using an extended version of the Visual Studio generated MVC3 RegisterModel. Voila, it generates a captcha on every refresh, but this in itself is pretty useless. The first thing I tried was exposing the following method on my controller: The issue I'm having is getting it working with MVC itself. The code I've ripped out of the methods works fine and returns everything correctly. Below is the signature of my captcha class:

I've written the captcha generator, and now I need to do is plumb it in to the MVC framework. I'm fairly new to MVC and I'm finding the concepts behind it quite a challenge.
CUSTOM CAPTCHA GENERATOR INSTALL
I'm looking for ways in which I can integrate my solution in to MVC3 WITHOUT using the ViewBag or a custom HttpHandler. View Demo View Github Install npm install captcha-image yarn add captcha-image Options You can pass following parameters to Captcha instance in order to generate custom Captcha image Events createImage () method return HTML element parsed as String Output Final outcome looks like this: looking for a coding solution rather than an existing solution.

CUSTOM CAPTCHA GENERATOR GENERATOR
I'm writing my own CAPTCHA generator for MVC3 - mostly to learn the MVC3 architecture in more depth.

Sheo Narayan Sheo Narayan Not the answer you're looking for? Browse other questions tagged -mvc-4captcha or ask your own question.
