-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasic.cshtml
More file actions
50 lines (47 loc) · 1.21 KB
/
Basic.cshtml
File metadata and controls
50 lines (47 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@using System.Linq
@using Aliencube.ReCaptcha.Wrapper.Mvc
@model Aliencube.ReCaptcha.Wrapper.WebApp.Models.HomeReCaptchaViewModel
@{
ViewBag.Title = "Basic";
}
<h2>@ViewBag.Title</h2>
@if (!IsPost)
{
using (Html.BeginForm(MVC.Home.ActionNames.Basic, MVC.Home.Name, FormMethod.Post))
{
<div class="form-group">
@Html.LabelFor(m => m.Name)
@Html.TextBoxFor(m => m.Name, new { @class = "form-control" })
</div>
@Html.ReCaptcha(Model.SiteKey, new { @class = "form-group" })
<input class="btn btn-default" type="submit" name="Submit" />
}
}
else
{
<div>
<ul>
<li>Name: @Model.Name</li>
<li>Success: @Model.Success</li>
@if (@Model.ErrorCodes != null && @Model.ErrorCodes.Any())
{
<li>
ErrorCodes:
<ul>
@foreach (var errorCode in Model.ErrorCodes)
{
<li>@errorCode</li>
}
</ul>
</li>
}
</ul>
</div>
}
@section Scripts
{
@if (!IsPost)
{
@Html.ReCaptchaApiJs(Model.ApiUrl)
}
}