Skip to content

Instantly share code, notes, and snippets.

<!--This setting can be used to override whether the Active Directory synchronization service adheres to the WebHooks_UserWebHookUrl Global Setting. This allows installation to prevent AD Services from firing web hooks. -->
<add key="SendWebHooksFromDirectoryServices" value="True" />
<!-- The Url given in this setting will be used as a Http Callback for User specific events (e.g. user login, logoff, user updated details) within the this published website. -->
<add key="WebHooks_Website_UserWebHookUrl" value="http://[yourwebsiteaddress]/api/Webooks/SampleEndPoint" />
@using CMS_API.WebHooks
@using Zengenti
@{
// Reference the static list declared in our ApiController
var webhookList = WebHookApiController.WebHookResponseList;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using CMS_API.WebHooks;
using Contensis.Framework.Web.Controllers;
namespace [YourNamespace]
{
@using (Html.BeginContensisForm("MyAction", "api/MyApiController"))
{
@Html.ValidationSummary("Validation Summary", new { @class = "validation-summary-class" })
Html markup for inputs in here
@Html.ContensisFormSummary("<p>The result from the ApiContoller is:</p>", new { @class = "myFormSummaryClass" })
}
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Web.Http;
using Contensis.Framework.Web.Controllers;
namespace Zengenti
{
[RoutePrefix("api/MyApiController")]
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Web.Http;
using Contensis.Framework.Web.Controllers;
namespace Zengenti
{
[RoutePrefix("api/MyApiController")]
public class MyController : ContensisApiController
@using Contensis.Framework.Web
@{
AppContext.Current.Page.Scripts.Add("/siteelements/scripts/jqueryvalidate/jquery.validate.js");
AppContext.Current.Page.Scripts.Add("/siteelements/scripts/jqueryvalidate/jquery.validate.unobtrusive.js");
// define some validation rules against fields within the Form
Validation.Add("Username",
Validator.Required("You must provide a username"),
Validator.StringLength(10, 0, "No more than 10 letters")
...
@using (Html.BeginContensisForm("MyAction", "api/MyApiController"))
{
@Html.ValidationSummary("Validation Summary", new { @class = "validation-summary-class" })
<div class="form-group">
<label for="firstname">Firstname:</label>
@Html.TextBox("Firstname", null, new { @type = "email", @class = "form-control" })
</div>
...
}
mailChimp.Subscribe(mailListId, emailAddress, customFields);