Files
BeWoPlaner/BeWoPlanerMobil/Global.asax.cs

55 lines
1.8 KiB
C#

using DevExpress.Web.Mvc;
using log4net.Config;
using System;
using System.Globalization;
using System.Net;
using System.Threading;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace BeWoPlanerMobil
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : HttpApplication
{
private readonly CultureInfo _CultureInfo = new CultureInfo("de-DE");
protected void Application_Start()
{
Thread.CurrentThread.CurrentCulture = _CultureInfo;
Thread.CurrentThread.CurrentUICulture = _CultureInfo;
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
XmlConfigurator.Configure();
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
// ToDo: Könnte Probleme beim Login machen, falls der den Header der Login-Anfrage benutzt.
Response.Headers["Referrer-Policy"] = "no-referrer";
}
protected void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
DevExpressHelper.Theme = "MaterialCompact";
DevExpress.Web.ASPxWebControl.GlobalThemeBaseColor = "#FF5A00";
Thread.CurrentThread.CurrentCulture = _CultureInfo;
Thread.CurrentThread.CurrentUICulture = _CultureInfo;
}
}
}