Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Last active November 30, 2022 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sitefinitySDK/8e7549e04bea252712f4ec2df697e9c5 to your computer and use it in GitHub Desktop.
Save sitefinitySDK/8e7549e04bea252712f4ec2df697e9c5 to your computer and use it in GitHub Desktop.
SF_11.0, SF_11.1, SF_11.2, SF_12.0, SF_12.1, SF_12.2, SF_13.0, SF_13.1, SF_13.2, SF_13.3, SF_14.0, SF_14.1, SF_14.2, SF_14.3 - https://docs.sitefinity.com/for-developers-forms-events
using System;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Modules.Forms.Events;
using Telerik.Sitefinity.Services;
namespace SitefinityWebApp
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
Bootstrapper.Bootstrapped += Bootstrapper_Bootstrapped;
}
private void Bootstrapper_Bootstrapped(object sender, EventArgs e)
{
EventHub.Subscribe<IFormsModuleEvent>(evt => FormsEventHandler(evt));
}
public void FormsEventHandler(IFormsModuleEvent eventInfo)
{
// When you handle a generic event, no information is passed to your event handler
// You can use a more specific event, for example
if (eventInfo is IFormEntryCreatedEvent)
{
var formEntryCreatedEventInfo = eventInfo as IFormEntryCreatedEvent;
var formName = formEntryCreatedEventInfo.FormName;
// ...
}
else if (eventInfo is IFormEntryUpdatedEvent)
{
// ...
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment