I'm writing an ASP.NET MVC site where I want to display a CAPTCHA when content that a user submits fails my Akismet spam check. I know how to display the CAPTCHA, but I'm having trouble imagining and planning the architecture for this. Here's what I'm currently thinking:
return RedirectToAction()
and sends the user off to the CAPTCHA action My question is: how should I engineer the return of the user to the original action? I need to somehow carry the data that the user submitted, as well as the name of the original action, into the CAPTCHA action so that RedirectToAction
includes both.
Any ideas? Thanks in advance.
UPDATE:
Mare's answer below linked to a recording of a session at PDC 2008 where Jeff Atwood showed a little bit of the CAPTCHA code that Stack Overflow uses. The end result that I'm going for is essentially how CAPTCHAs work here on Stack Overflow.
The CAPTCHA submission code that Jeff showed does the following:
return Redirect(resultUrl);
That solves part of my question. However, there are still a few things that I don't understand:
Session["captcha-returnUrl"]
from the method that calls the CAPTCHA? Maybe you can find some ideas in an old video from PDC 08 where Jeff Atwood talks about Recaptcha implementation at Stack Overflow, its somewhere in the middle of the video: http://channel9.msdn.com/pdc2008/PC21/
Hope it helps
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.