Created
February 17, 2018 13:03
-
-
Save MoienTajik/54849fbeb1efb719e59a2f8698485e5e to your computer and use it in GitHub Desktop.
Using Google reCAPTCHA in ASP.NET MVC - Create View
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using GoogleRecaptcha.Infrastructure.HtmlHelpers | |
@{ | |
ViewBag.Title = "Create"; | |
} | |
<h2>@ViewBag.Title</h2> | |
<h4>Some test form that needs reCAPTCHA !</h4> | |
<hr /> | |
@using (Html.BeginForm("Create", "Test", FormMethod.Post, new { @class = "form-horizontal" })) | |
{ | |
@Html.AntiForgeryToken() | |
<div class="form-group"> | |
@Html.Label("Title", new { @class = "control-label col-md-2" }) | |
<div class="col-md-10"> | |
@Html.TextBox("Title", "", new { @class = "form-control" }) | |
</div> | |
</div> | |
<div class="form-group"> | |
<div class="col-md-offset-2 col-md-10"> | |
@Html.GoogleCaptcha() | |
@Html.InvalidGoogleCaptchaLabel("Captcha is not valid !") | |
</div> | |
</div> | |
<div class="form-group"> | |
<div class="col-md-offset-2 col-md-10"> | |
<input type="submit" value="Create" class="btn btn-primary" /> | |
</div> | |
</div> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment