Thanks a lot for Marina's informative suggestions.
Hi Ali,
Thanks for posting here. I've found that you've also posted another post
subjected "Subject: Redirect from Global ASAX" in this queue discusing on
the similar problem of the global object, yes?
I think Marina's suggestion is correct that the Constructor of global
object is not the proper place to do intialization operations , also since
at that time the HttpContext.Current haven't been initialzed with instance
value, so we can't write trace in it. As I 've replied in the other thread,
I suggest that you use the Applicatoin_Start Event of the global object to
do some initialize operations of the application. And in this event, the
Current Request's necessary instrinct components are all constructed, we
can use the following code to write trace to current request(the first
request of the application):
protected void Application_Start(Object sender, EventArgs e)
{
........
HttpContext.Current.Trace.Write("Global():Trace at:
"+DateTime.Now.ToLongTimeString());
}
thus, we can got this info in the sequential page's trace info list if we
trun on the page's trace.
Please check out the suggestions in the other thread as well and if you
have anything unclear, please feel free to let me know.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx