Global.asax file is not working - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Global.asax file is not working

  • Global.asax file is not working
  • Hi,

    We are trying to merge the publish code of an asp.net application with sitefinity cms app. After merging the code, the code written in Global.asax file in asp.net app stop working due to which URL rewriting and error handling concept given in Global.asax file fails. Kindly suggest how could we fix this.

    Thanks in advance.
  • Alma,

    If you have sample code we can try and help you some more.  But here is a successful global file we use.  Hopefully this helps!  Make sure you are building your solution after you modify your Global.asax.

    using System;
    using Aptera.Widgets.Configurations;
    using Telerik.Sitefinity.Configuration;
    using Telerik.Sitefinity.GenericContent.Model;
    using Telerik.Sitefinity.Modules.ControlTemplates;
    using Telerik.Sitefinity.Modules.Pages;
    using SitefinityWebApp.App_Code;
     
    namespace SitefinityWebApp
        public class Global : System.Web.HttpApplication
        
     
            protected void Application_Start(object sender, EventArgs e)
            
                Telerik.Sitefinity.Abstractions.Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
            
     
            void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
            
                if (e.CommandName == "Bootstrapped")
                
                    CreateWidgetTemplates();
                    Config.RegisterSection<CalloutConfig>();
                    Config.RegisterSection<FormsAskimetCredentials>();
                
     
                Telerik.Sitefinity.Scheduling.SchedulingManager schedulingManager = Telerik.Sitefinity.Scheduling.SchedulingManager.GetManager();
                string myKey = "RecurringScheduledTask";
                SitefinityWebApp.App_Code.RecurringScheduledTask newTask = new SitefinityWebApp.App_Code.RecurringScheduledTask()
                
                    Key = myKey,
                    ExecuteTime = DateTime.UtcNow.Subtract(TimeSpan.MaxValue),
                ;
                schedulingManager.AddTask(newTask);
                schedulingManager.SaveChanges();
            
     
            void CreateWidgetTemplates()
            
                PageManager pageManager = PageManager.GetManager();
                ControlTemplates.RegisterTemplatableControl(typeof(Aptera.Widgets.Callout), typeof(ContentItem), null, "Callouts", "Callouts");
                pageManager.SaveChanges();
            
     
            protected void Session_Start(object sender, EventArgs e)
            
     
            
     
            protected void Application_BeginRequest(object sender, EventArgs e)
            
     
            
     
            protected void Application_AuthenticateRequest(object sender, EventArgs e)
            
     
            
     
            protected void Application_Error(object sender, EventArgs e)
            
     
            
     
            protected void Session_End(object sender, EventArgs e)
            
     
            
     
            protected void Application_End(object sender, EventArgs e)