Skip to content

Instantly share code, notes, and snippets.

@victorighalo
Created March 9, 2018 15:08
Show Gist options
  • Save victorighalo/328bf74eca16fae817ace0d3834dcee5 to your computer and use it in GitHub Desktop.
Save victorighalo/328bf74eca16fae817ace0d3834dcee5 to your computer and use it in GitHub Desktop.
Umbraco Contact Form Partial
@inherits Umbraco.Web.Mvc.UmbracoViewPage<Wyzweb.Models.Contact>
@using Umbraco.Web
@using Recaptcha.Web.Mvc;
@if (TempData.ContainsKey("Response"))
{
<div class="alert alert-info" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@TempData["Response"]
</div>
}
@using (Html.BeginUmbracoForm("SubmitForm", "Contact", System.Web.Mvc.FormMethod.Post, new { @class="form-horizontal", role="form" }))
{
<div class="">
@if(Html.ValidationSummary() != null){
<div class="alert alert-danger" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
@Html.ValidationSummary()
</div>
}
@Html.AntiForgeryToken()
<div class="form-group">
<div class="col-md-12">
@Html.LabelFor(m => m.Fullname)
@Html.TextBoxFor(m => m.Fullname, new { placeholder = "Full Name", @class = "form-control" })
</div>
<div class="col-md-12">
@Html.LabelFor(m => m.Subject)
@Html.TextBoxFor(m => m.Subject, new { placeholder = "Subject", @class = "form-control" })
</div>
<div class="col-md-12">
@Html.LabelFor(m => m.Message)
@Html.TextAreaFor(m => m.Message, new { placeholder = "Message", @class = "form-control" })
</div>
</div>
<button name="contact" type="submit" class="btn btn-info btn-lg pull-left" style="border-radius:0px">
Send
</button>
</div>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment