我正在使用VS 2008.我從File-> New-> Website-> Asp.net Website創建了一個新的Asp.net網站項目。Global.asax.cs文件在哪裏?
現在我想將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文件在哪裏?
謝謝
http://stackoverflow.com/questions/6055927/where-is-global-asax-cs-in-visual-studio-2010 :) – naveen 2011-06-09 05:03:23