【发布时间】:2012-01-07 13:09:26
【问题描述】:
我有需要使用验证码的 mvc 网络应用程序, 我这样做就像添加一个我从 codeplex 获得的 dll 但是 在 register.aspx 页面上,我添加了如下代码,这给了我验证码
<%: CaptchaMVC.HtmlHelpers.CaptchaHelper.Captcha(Html,"Refresh","Input Symbols",5) %>
以及 AccountController.cs 中的代码:
[HttpPost]
public ActionResult NotAttribute()
{
if (this.IsCaptchaVerify("Captcha is not valid"))
{
TempData["Message"] = "Captcha is valid";
return View();
}
TempData["Message"] = "Captcha is not valid";
return View();
}
[HttpPost]
[CaptchaVerify("Captcha is not valid")]
public ActionResult UseAttribute()
{
if (ModelState.IsValid)
{
TempData["Message"] = "Captcha is valid";
return View();
}
TempData["Message"] = "Captcha is not valid";
return View();
}
但是在点击注册按钮后它不能像调试模式一样正常工作,它无法点击这些方法中的任何一个 为什么?
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-3 captcha