Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.ComponentModel;
- using System.Web.WebPages.Razor;
- using Microsoft.Web.Infrastructure.DynamicModuleHelper;
- namespace MVCViewScriptLibrary {
- /// <summary>
- /// Added to assemblyInfo.cs
- /// [assembly: PreApplicationStartMethod(typeof(MVCViewScriptLibrary.PreApplicationStartCode), "Start")]
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static class PreApplicationStartCode {
- private static bool _startWasCalled;
- public static void Start() {
- if (_startWasCalled) {
- return;
- }
- _startWasCalled = true;
- //class to call the 'Start' method
- DynamicModuleUtility.RegisterModule(typeof(ViewScriptModule));
- //Add namespace of helper class
- WebPageRazorHost.AddGlobalImport(typeof(ViewScriptUrlHelperExtentions).Namespace);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment