コード例 #1
0
        void Application_Start(object sender, EventArgs e)
        {
            // Code that runs on application startup
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            DevExpress.XtraReports.Web.ASPxReportDesigner.StaticInitialize();

            string dataPath = Server.MapPath("Images/");

            AccessSettings.StaticResources.TrySetRules(DirectoryAccessRule.Allow(dataPath));

            string devoImagesPath = Server.MapPath("ImagesDevoluciones/");

            AccessSettings.StaticResources.TrySetRules(DirectoryAccessRule.Allow(devoImagesPath));
        }
コード例 #2
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;
        }
コード例 #3
0
ファイル: Global.asax.cs プロジェクト: MohdAwad/Acc
        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());
        }
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);

            ModelBinders.Binders.DefaultBinder = new DevExpressEditorsBinder();
            AccessSettings.StaticResources.TrySetRules(DirectoryAccessRule.Allow());

            // See https://documentation.devexpress.com/Dashboard/DevExpress.DashboardWeb.DashboardFileStorage.class
            //DashboardConfigurator.Default.SetDashboardStorage(new DashboardFileStorage(@"~/App_Data/Dashboards"));
            DashboardConfigurator.Default.SetDashboardStorage(PublicDemo.SessionDashboardStorage.Instance);// this code based on DevExpress demo

            DashboardExcelDataSource ds = new DashboardExcelDataSource("Excel Data Source");

            ds.SourceOptions = new ExcelSourceOptions(new ExcelWorksheetSettings("List"));
            ds.FileName      = @"|DataDirectory|Data\PresidentsData.xlsx";
            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            dataSourceStorage.RegisterDataSource("dashboardExcelDataSource1", ds.SaveToXml());
            DashboardConfigurator.Default.SetDataSourceStorage(dataSourceStorage);
        }
コード例 #5
0
        void Application_Start(object sender, EventArgs e)
        {
            string dataPath = Server.MapPath(@"~/App_Data/Images/");

            AccessSettings.StaticResources.TrySetRules(DirectoryAccessRule.Allow(dataPath));
        }
コード例 #6
0
 void Application_Start(object sender, EventArgs e)
 {
     AccessSettings.DataResources.SetRules(DirectoryAccessRule.Allow(Server.MapPath("~/Content")), UrlAccessRule.Allow());
 }
コード例 #7
0
 protected void Application_Start(Object sender, EventArgs e)
 {
     SecurityAdapterHelper.Enable();
     RouteTable.Routes.RegisterXafRoutes();
     ASPxWebControl.CallbackError += new EventHandler(Application_Error);
     DevExpress.XtraReports.Web.WebDocumentViewer.DefaultWebDocumentViewerContainer.RegisterSingleton <WebDocumentViewerOperationLogger, ViewerOperationLogger>();
     DevExpress.Security.Resources.AccessSettings.ReportingSpecificResources.SetRules(DirectoryAccessRule.Allow("C:\\StaticResources\\"), SerializationFormatRule.Deny(DevExpress.XtraReports.UI.SerializationFormat.CodeDom));
 }