Tổng Bài đăng:
137
Karma:
893
Đã tham gia:
12/06/2012
Vị trí:
United Kingdom
I am in the process of putting together a custom tec support page that links in to sage CRM, I like to be able to use the ReCaptcha on that page to stop spamming how do I go about integrating it in to a new page. ta
Tổng Bài đăng:
2128
Karma:
19233
Đã tham gia:
06/11/2009
Vị trí:
Malaysia
How did you implement the page? As a topic? :)
Tổng Bài đăng:
137
Karma:
893
Đã tham gia:
12/06/2012
Vị trí:
United Kingdom
No I am building the page from scratch... as it links in to other custom sections I have built to pull data. I have got the page to display the caption but it not validating... It still allowing it through there the code I am using [HttpPost, ActionName("SupportRequest")] [CaptchaValidator] public ActionResult RequestSupport(FormCollection collection, bool captchaValid) { if (captchaValid == false) { RedirectToAction("/SupportRequest"); } TechSupportRequest Ntool = new TechSupportRequest(); //Read the config file..... Ntool.readfile(); //ProductVersions = collection["Searchstring"]; Ntool.Name = collection["Name"]; Ntool.Organisation = collection["Organisation"]; Ntool.Address = collection["Address"]; Ntool.City = collection["City"]; Ntool.County = collection["County"]; Ntool.Postcode = collection["Postcode"]; try { Ntool.CountryRegion = long.Parse(collection["Country"]); } catch { Ntool.CountryRegion = 0; } Ntool.Email = collection["Email"]; try { Ntool.WhichProduct = long.Parse(collection["LucidProducts"]); } catch { Ntool.WhichProduct = 0; } try { Ntool.Version = long.Parse(collection["ProductVersions"]); } catch { Ntool.Version = 0; } Ntool.SerialNo = collection["SRNO"]; Ntool.DescriptionofProblem = collection["Problem"]; Ntool.AddRecord(); return View(); } Don't worry about Ntool that a component I have built to store the data so that it can be drop in to Sage CRM at a later point. The bit I am having problem with is if (captchaValid == false) { RedirectToAction("/SupportRequest"); } It allow any thing through, it either erroring or just allowing stuff through. Help!!!
Tổng Bài đăng:
137
Karma:
893
Đã tham gia:
12/06/2012
Vị trí:
United Kingdom
I am putting that on the page and it is generating the caption on the page. But when I call the post back code it not executing the check, it adding the values to the DB and then sending the person to the thanks page with out checking the caption.
Tổng Bài đăng:
137
Karma:
893
Đã tham gia:
12/06/2012
Vị trí:
United Kingdom
Sorry it was me been a numpty it checking the value but I forgot to do the redirect correctly. so the correct code should be.... [HttpPost] [CaptchaValidator] public ActionResult RequestSupport(FormCollection collection, bool captchaValid) { if (captchaValid==false) { Action if false} action if true } Well at lest I have it working that one less problem I have to worry about.