是用来做什么的Global.asax? [英] What is global.asax used for?
问题描述
什么是的的Global.asax
ASP.NET中的目的是什么?
Global.asax文件,也称为ASP.NET应用程序文件,是包含code用于响应由ASP.NET或通过HTTP模块提出应用级和会话级别的事件的可选文件。 Global.asax文件驻留在ASP.NET应用程序的根目录。在运行时,Global.asax中被解析并编译成从HttpApplication基类派生的动态生成.NET Framework类。 ASP.NET被配置,对于Global.asax文件的任何直接URL请求将被自动拒绝;外部用户不能下载或查看code在里面。
Global.asax文件是可选的。您可以创建只,如果你想处理应用程序或会话事件。
块引用>(MSDN <一个href=\"http://msdn.microsoft.com/en-us/library/2027ewzw%28v=vs.100%29.aspx\">http://msdn.microsoft.com/en-us/library/2027ewzw%28v=vs.100%29.aspx)
What is the purpose of the
global.asax
in ASP.NET?解决方案The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level and session-level events raised by ASP.NET or by HTTP modules. The Global.asax file resides in the root directory of an ASP.NET application. At run time, Global.asax is parsed and compiled into a dynamically generated .NET Framework class derived from the HttpApplication base class. ASP.NET is configured so that any direct URL request for the Global.asax file is automatically rejected; external users cannot download or view the code in it. The Global.asax file is optional. You create it only if you want to handle application or session events.
(MSDN http://msdn.microsoft.com/en-us/library/2027ewzw%28v=vs.100%29.aspx)
这篇关于是用来做什么的Global.asax?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!