当我创建Global.Asax.Cs页面时,什么是命名空间..... [英] What Will Be A Namespace When I Create Global.Asax.Cs Page.....
问题描述
当我创建Global.asax.cs页面时,那将是命名空间....
案例,
在global.asax.cs页面
命名空间---------
{
公共类Global:System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
在这种情况下我无法理解为什么我们使用Global.asax.cs页面后面的代码....
通常,global.asax会引用项目命名空间中的Global类,如下所示:
<%@ Application Codebehind =Global.asax.csInherits =WebApplication1.GlobalLanguage =C#%>
并且global.asax.cs因此将被命名为:
namespace WebApplication1
{
public class 全局:HttpApplication
{
}
}
Hi , when i create Global.asax.cs page then what will be the namespace ....
the case,
in global.asax.cs page
namespace ---------
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
in this case i could not understand that why we use code behind Global.asax.cs page ....
Normally, global.asax would reference the Global class in the namespace of your project, like so:
<%@ Application Codebehind="Global.asax.cs" Inherits="WebApplication1.Global" Language="C#" %>
And global.asax.cs would be thus namespaced:
namespace WebApplication1 { public class Global : HttpApplication { } }
这篇关于当我创建Global.Asax.Cs页面时,什么是命名空间.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!