Esempio n. 1
0
        //========================================================================================================================
        //========================================================================================================================

        protected void Application_Start()
        //========================================================================================================================
        // Perform processing in response to an application start event.
        //
        // Developer Notes
        //      The application start event is fired the first time a user visits the site and before the session is created.
        //========================================================================================================================
        {
            // Deveoper Notes
            //      Areas: Define a set separate of Controllers, Models and Views specifically for the pages in that area
            //
            // Register any custom areas
            AreaRegistration.RegisterAllAreas();

            // Configure the Web.api based on settings in WebApiConfig
            // Register any request filters
            // Register any custom request routes
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            // Deveoper Notes
            //      Out of the box, VS2019 does not allow the addition of subfolders under the Views folder. This can
            //      cause organizational issues for a website with many views. To fix this drawback, a third party
            //      product called EnhancedViewLocations is used that provides the desired functionality.
            //
            // Register additional view folders
            RegisterCustomViewFolders();

            // DevExpress initialization

            // Developer Notes
            //      When DevExpress editors are bound to corresponding data model fields by using their Bind methods, the
            //      DevExpressEditorsBinder model binder must be used to correctly transfer values from DevExpress editors back
            //      to the corresponding data model fields.
            // Assign the DevExpress model binder as the default
            ModelBinders.Binders.DefaultBinder = new DevExpress.Web.Mvc.DevExpressEditorsBinder();

            // Insure server-based grid filtering is case-insensitive
            // Allow images to be loaded from any directory or URL
            DevExpress.Data.Helpers.ServerModeCore.DefaultForceCaseInsensitiveForAnySource = true;
            DevExpress.Security.Resources.AccessSettings.StaticResources.SetRules(DirectoryAccessRule.Allow(), UrlAccessRule.Allow());

            // Global error handing for application errors
            DevExpress.Web.ASPxWebControl.CallbackError += Application_Error;
        }
Esempio n. 2
0
 void Application_Start(object sender, EventArgs e)
 {
     AccessSettings.DataResources.SetRules(DirectoryAccessRule.Allow(Server.MapPath("~/Content")), UrlAccessRule.Allow());
 }
Esempio n. 3
0
        protected void Application_Start()
        {
            DevExpress.XtraReports.Web.QueryBuilder.Native.QueryBuilderBootstrapper.SessionState           = System.Web.SessionState.SessionStateBehavior.Disabled;
            DevExpress.XtraReports.Web.ReportDesigner.Native.ReportDesignerBootstrapper.SessionState       = System.Web.SessionState.SessionStateBehavior.Disabled;
            DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Disabled;


            // Images can be loaded only from the "C:\\StaticResources\\" file directory and "http://mysite.dev" site
            DevExpress.Security.Resources.AccessSettings.StaticResources.TrySetRules(DirectoryAccessRule.Allow("C:\\AccWeb\\Acc\\Acc\\CompanyLogo"), UrlAccessRule.Allow("http://mysite.dev"));


            //DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Disabled;
            //DevExpress.Utils.UrlAccessSecurityLevelSetting.SecurityLevel = DevExpress.Utils.UrlAccessSecurityLevel.Unrestricted;


            //  DevExpress.Utils.UrlAccessSecurityLevelSetting.SecurityLevel = DevExpress.Utils.UrlAccessSecurityLevel.Unrestricted;
            //ScriptPermissionManager.GlobalInstance = new ScriptPermissionManager(ExecutionMode.Unrestricted);
            //    DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Disabled;
            //    DevExpress.XtraReports.Web.QueryBuilder.Native.QueryBuilderBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Disabled;
            //    DevExpress.XtraReports.Web.ReportDesigner.Native.ReportDesignerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Disabled;
            // Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MTQ2MTg2QDMxMzcyZTMzMmUzMG1tbHFkVnRpNUd5TmhLNGI2NFJucW9Rb2xydkNMQkJmUGRPQWpDc0tzSFE9");
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            ModelBinders.Binders.DefaultBinder = new DevExpress.Web.Mvc.DevExpressEditorsBinder();

            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ar-JO");
            Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
            Thread.CurrentThread.CurrentCulture.DateTimeFormat.LongDatePattern  = "dd/MM/yyyy";
            //DevExpress.Web.Mvc.MVCxReportDesigner.StaticInitialize();
            DevExpress.Web.Mvc.MVCxWebDocumentViewer.StaticInitialize();
            DevExpress.Web.Mvc.MVCxReportDesigner.StaticInitialize();
            // ...
            //  DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension.RegisterExtensionGlobal(new CustomReportStorageWebExtension);
            // ..
            //  DevExpress.XtraReports.Web.Extensions.ReportStorageWebExtension.RegisterExtensionGlobal(new ReportStorageWebExtension1());
        }