如果建立的是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" 这里就有名称空间
namespace WebApplication1
{
    
public partial class _Default : System.Web.UI.Page
    
{
        
protected void Page_Load(object sender, EventArgs e)
        
{

        }

    }

}

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



posted on 2008-01-07 09:56  AGPSky  阅读(410)  评论(0编辑  收藏  举报