From 2d67828b0d590dc23ba791013d184c52901e8486 Mon Sep 17 00:00:00 2001 From: Phat Ly Date: Wed, 1 Apr 2015 17:35:01 +0700 Subject: [PATCH] Update README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index f1f11df..bbafa27 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,12 @@ In order to use for asp.net mvc, you need to install more a helper package. This ``` Install-Package GoogleRecaptchaMvc ``` +In order to use for asp.net web forms, you need to install more a package. This package is used to create the server control for Google Recaptcha: + +``` Install-Package GoogleRecaptchaWebForms ``` + ### Samples +#### ASP.NET MVC We will have a minor sample for asp.net mvc. In this sample, we have a view called __Index.cshtml__ and a controller named __HomeController__. In __index__ view, we will render the html control with the Google reCaptcha version 2 format. Also, HomeController will have 2 actions inside it. The first action is to implement the GET request. The second action is to implement the POST request used to verify the Google Recaptcha. The following is the sample code: __Index.cshtml__: @@ -57,6 +62,37 @@ public class HomeController: Controller } ``` +#### ASP.NET Web Forms +For asp.net web forms, after you have installed the library, you have two ways to use it: +* Refer to it in web.config: +```xml +... + + + + + + + + + +... +``` +* Refer to it in each pages aspx or user controls ascx: +```xml +<%@ Register TagPrefix="asp" Namespace="GoogleRecaptchaWebForms" Assembly="GoogleRecaptchaWebForms" %> +``` + +Next you can use server control of Google Recaptcha for any page or user control: +```xml +... + +... +``` + +Finally on the server-side, you can verify the captcha by using __Page.IsValid__ or __gRecaptcha.IsValid__. The success is __true__, otherwise is __false__ + ### Bugs and Issues If any issue or bug, please push a new issue [here](https://github.com/congdongdotnet/GoogleRecaptcha/issues). @@ -65,6 +101,7 @@ If any issue or bug, please push a new issue [here](https://github.com/congdongd * 1.0.1: Add the meaningful comments into code and fix some following performance bugs: * Dispose and close the unnecessary resources when using MemoryStream. * Use the HtmlHelper class in the namespace System.Web.Mvc instead of System.Web.WebPages.Html. +* 1.1.1: Support the Google Recaptcha version 2 for asp.net web forms. ### Copyright and License Copyright 2015 by CongDongDotNet - MIT License