我正在使用VS 2008。 我从“文件”->“新建”->“网站”->“Asp.net网站”创建了一个新的Asp.net网站项目。
现在我想将Global.asax和.cs文件添加到该项目中。 因此,我右键单击项目->添加新项->全局应用程序类。 然后我点击添加按钮。
Global.asax文件已添加,并包含以下内容
<%@ Application Language="C#" %>
<script runat="server"%>
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
}
void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown
}
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
}
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
}
</script>
这很好。但是 Global.asax.cs 文件在哪里?
谢谢