如果建立的是web site
那么
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
CodeFile="Default.aspx.cs"
Inherits 这里只有类名,原因是.cs文件里面默认没有名称空间

如果建立的是web application
那么
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
CodeBehind="Default.aspx.cs"
Inherits="WebApplication1._Default" 这里就有名称空间
vs2005和vs2008默认建立web site和web application 生成的webform源码的一点区别namespace WebApplication1

最主要的区别就是codebehind和codefile。不知道原因是什么。



相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2022-02-19
  • 2022-01-17
  • 2021-08-09
  • 2021-07-10
猜你喜欢
  • 2021-06-06
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2021-12-06
相关资源
相似解决方案