Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've implemented global.asax file, and I have two issues:
1) from some reason, Global.asax.cs fils is never being hit.
2) I used a work-around to solve it (not that I like that). It looks like this:
<%@ Application CodeBehind="Global.asax.cs" Inherits="Umbraco.Web.UmbracoApplication" Language="C#" %>
protected void Session_Start(object sender, EventArgs e)
// Session start logic here
protected void Application_BeginRequest(object sender, EventArgs e)
var x = 1;
protected void Application_EndRequest(object sender, EventArgs e)
protected void Session_End(object sender, EventArgs e)
protected new void Application_Error(object sender, EventArgs e)
Exception ex = HttpContext.Current.Server.GetLastError();
Umbraco.Core.Logging.LogHelper.Error(this.GetType(), ex.Message, ex);
it works, BUT, the Application_Error event is being called twice!
Rotem, in my Global.asax I'm instead overriding the OnApplicationError method, and seems to be working fine:
protected override void OnApplicationError(object sender, EventArgs e)
GlobalErrorHandler.TransferToCustomErrorPage(this, e, ContentNavigator.CustomErrorPageUrl);
if (!Request.IsLocal || Context.IsCustomErrorEnabled)
The content inside the method is just our implementation of course.
Thank you for the reply.
I'll try that. do you happen to know why my .cs file code is not being fired. and I have to write my code in
You know, I haven't actually tried that, but I think you'd have to place the codebehind file in the App_code folder. Maybe try this: CodeBehind=”~/App_Code/global.asax.cs” (and also place the file there of course).
Unfortunately it doesn't work. :(
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted