KB-TimothyHumphrey CAPTCHA causes post preview error

I added TimothyHumphrey's CAPTCHA web control to CS2.1 forum post editor to prevent from spam-post.  A friend told me, when he wrote a post in anonymous, press preview tab will cause a AJAX error.  After tracing request and response with Fiddler, I found the Validate() method of TimothyHumphrey.WebControl.Captcha throw a null reference exception.  Dig deeper, the request contain several Ajax_blah post variables, and I guess that TimothyHumphrey's CAPTCHA doesn't behave normally duration AJAX post back model.  After modified Validate() method to skip checking when Request["Ajax_CallBackMethod"] is detected, it seems OK now.

TimothyHumphrey.WebControl.Captcha.cs

  519         public void Validate() {

  520             //2007-02-01 Modified by Jeffrey Lee

  521             //Skip the validation while AJAX preview

  522             if (this.Context.Request["Ajax_CallBackMethod"] != null)

  523                 return;

  524 

  525             HttpCookie cookie = this.Context.Request.Cookies[CaptchaImagePage.CookieName];

  526             bool valid;

歡迎推文分享:
Published 01 February 2007 08:54 AM 由 Jeffrey
Views: 10,675



意見

沒有意見

你的看法呢?

(必要的) 
(必要的) 
(選擇性的)
(必要的) 
(提醒: 因快取機制,您的留言幾分鐘後才會顯示在網站,請耐心稍候)

5 + 3 =

搜尋

Go

<February 2007>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728123
45678910
 
RSS
創用 CC 授權條款
【廣告】
twMVC

Tags 分類檢視
關於作者

一個醉心技術又酷愛分享的Coding魔人,十年的IT職場生涯,寫過系統、管過專案, 也帶過團隊,最後還是無怨無悔地選擇了技術鑽研這條路,近年來則以做一個"有為的中年人"自許。

文章典藏
其他功能

這個部落格


Syndication