﻿@using Aliencube.ReCaptcha.Wrapper.Mvc
@model Aliencube.ReCaptcha.Wrapper.WebApp.Models.HomeIndexViewModel
@{
    ViewBag.Title = "Index";
}

<h2>@ViewBag.Title</h2>

@using (Html.BeginForm(MVC.Home.ActionNames.Index, MVC.Home.Name, FormMethod.Post))
{
    <div class="form-group">
        @Html.LabelFor(m => m.Name)
        @Html.TextBoxFor(m => m.Name, new Dictionary<string, object>() {{"class", "form-control"}})
    </div>
    @Html.ReCaptcha(new Dictionary<string, object>() { { "class", "form-group" }, { "data-sitekey", Model.SiteKey } })
    <input class="btn btn-default" type="submit" name="Submit" />
}

@if (IsPost)
{
    <div>
        <ul>
            <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>
            }
            <li>ErorCodes: @Model.ErrorCodes</li>
        </ul>
    </div>
}

@section Scripts
{
    @Html.ReCaptchaApiJs(new Dictionary<string, object>() { { "src", Model.ApiUrl } })
}

﻿@using Aliencube.ReCaptcha.Wrapper.Mvc
@model Aliencube.ReCaptcha.Wrapper.WebApp.Models.HomeIndexViewModel
@{
    ViewBag.Title = "Index";
}

<h2>@ViewBag.Title</h2>

@using (Html.BeginForm(MVC.Home.ActionNames.Index, MVC.Home.Name, FormMethod.Post))
{
    <div class="form-group">
        @Html.LabelFor(m => m.Name)
        @Html.TextBoxFor(m => m.Name, new Dictionary<string, object>() {{"class", "form-control"}})
    </div>
    @Html.ReCaptcha(new Dictionary<string, object>() { { "class", "form-group" }, { "data-sitekey", Model.SiteKey } })
    <input class="btn btn-default" type="submit" name="Submit" />
}

@if (IsPost)
{
    <div>
        <ul>
            <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>
            }
            <li>ErorCodes: @Model.ErrorCodes</li>
        </ul>
    </div>
}

@section Scripts
{
    @Html.ReCaptchaApiJs(Model.ApiUrl, JsRenderingOptions.Async | JsRenderingOptions.Defer)
}

Update reCaptcha API js rendering script
Update reCaptcha API js rendering script
