Last post Mar 12, 2012 08:56 AM by BrockAllen
Member
429 Points
3843 Posts
Mar 12, 2012 08:50 AM|shapper|LINK
Hello,
I have the following on Global.asax:
protected void Application_Start() { InternalLogger.LogFile = HttpContext.Current.Server.MapPath("NLog.txt"); } protected void Application_Error() ILog log = LogManager.GetLogger(this.GetType()); Exception exception = Server.GetLastError(); if (log.IsErrorEnabled) log.Error(exception.Message, exception); }
How can I move this code to a module?
How can I inside the module reference Application_Start and Application_Error?
Thank You,
Miguel
All-Star
20376 Points
6505 Posts
ASPInsiders
MVP
Mar 12, 2012 08:56 AM|BrockAllen|LINK
For App_Start, any code that is in ~/bin can be called. Check out the PreApplicationStartMethod.
For App_Error, any http module can implement that.
Member
429 Points
3843 Posts
Move Code to Module
Mar 12, 2012 08:50 AM|shapper|LINK
Hello,
I have the following on Global.asax:
How can I move this code to a module?
How can I inside the module reference Application_Start and Application_Error?
Thank You,
Miguel
All-Star
20376 Points
6505 Posts
ASPInsiders
MVP
Re: Move Code to Module
Mar 12, 2012 08:56 AM|BrockAllen|LINK
For App_Start, any code that is in ~/bin can be called. Check out the PreApplicationStartMethod.
For App_Error, any http module can implement that.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/