This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.UI; | |
using Telerik.Sitefinity.Abstractions; | |
using Telerik.Sitefinity.Mvc; | |
using Telerik.Sitefinity.Mvc.Proxy; | |
using Telerik.Sitefinity.Services; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Telerik.Sitefinity.Abstractions; | |
using Telerik.Sitefinity.Web; | |
using Telerik.Microsoft.Practices.Unity; | |
using System.Collections.Specialized; | |
namespace SitefinityWebApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SitefinityWebApp | |
{ | |
public class Global : System.Web.HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
Bootstrapper.Initialized += new EventHandler<ExecutedEventArgs>(Bootstrapper_Initialized); | |
} | |
protected void Bootstrapper_Initialized(object sender, ExecutedEventArgs e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If this class is not already setup as a dynamic meta type - set it up. Without this, you cannot add custom fields to the type | |
if (metaManager.GetMetaType(typeof(Discount)) == null) | |
{ | |
metaManager.CreateMetaType(typeof(Discount)); | |
metaManager.SaveChanges(); | |
} | |
// The snippet below allows you to create a new property/field of the specified type (Discount). The benefit to this is that Sitefinity will actually create a new column for "Uses" and this can be saved/read using Sitefinity's functions: discountObject.GetValue<decimal>("Uses") and discountObject.SetValue("Uses", 1) | |
App.WorkWith() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomFormsControl : FormsControl | |
{ | |
protected override void InitializeControls(GenericContainer container) | |
{ | |
base.InitializeControls(container); | |
// Attaches to the FormSaved event to run custom code upon submitting a Form Builder form. | |
this.FormSaved += new EventHandler<System.EventArgs>(CustomFormsControl_FormSaved); | |
} |