>< %@ Application Language="C#" % > ><object id="GO" runat="server" class="GlobalObject" scope="Application"/> ><script runat="server"> > void Application_BeginRequest(object sender, EventArgs e) > { > Application.Lock(); > GO.SavedResponse = HttpContext.Current.Response; > GO.SavedRequest = HttpContext.Current.Request; > > DataEntryPurchase dep = new DataEntryPurchase(GO); > dep.Log("BeginRequest"); > } > > void Application_EndRequest(object sender, EventArgs e) > { > DataEntryPurchase dep = new DataEntryPurchase(GO); > dep.Log("EndRequest"); > Application.UnLock(); > } ></script> >>Relevant classes:
>public class GlobalObject >{ > private HttpRequest _savedRequest; > private HttpResponse _savedResponse; > > public HttpResponse ActualResponse > { > get{return HttpContext.Current.Response; } > } > > public HttpRequest ActualRequest > { > get { return HttpContext.Current.Request; } > } > > public HttpRequest SavedRequest > { > get { return _savedRequest; } > set { _savedRequest = value; } > } > > public HttpResponse SavedResponse > { > get { return _savedResponse; } > set { _savedResponse = value; } > } >} > >public class DataEntryPurchase >{ > private GlobalObject oFrame; > public DataEntryPurchase(GlobalObject o) > { > GO = o; > } > public void Log(string s) > { > GO.ActualResponse.Write(DateTime.Now.ToString() + ": " + s ); > GO.ActualResponse.Write("Saved: " +oFrame.SavedRequest.RawUrl) ; > GO.ActualResponse.Write("Actual: " + oFrame.ActualRequest.RawUrl); > } >} >>but this does force requests to be queued and processed sequentially. Whether this would give acceptable performance will depend on the level of hits the site is expected to receive (but even if acceptable it wouldn't 'feel right' to me). I tested with a couple of different aspx's with just 'System.Threading.Thread.Sleep(10000);' in the Page_Load. Removing the lock code will also demonstrate the problem you currently have..