在 VS.Net 2003中添加WEB窗体后,自动生成3个文件,运行错误
在   VS.Net   2003中添加WEB窗体后,自动生成3个文件: 
 WebForm2.aspx 
 WebForm2.aspx.cs 
 WebForm2.aspx.resx   
 在浏览器中运行:WebForm2.aspx   
 却有错误,为什么?     
 WebForm2.aspx 
 -------------------------   
  <%@   Page   language= "c# "   Codebehind= "WebForm2.aspx.cs "   AutoEventWireup= "false "   Inherits= "PetShop.Web.WebForm2 "   %>  
  <!DOCTYPE   HTML   PUBLIC    "-//W3C//DTD   HTML   4.0   Transitional//EN "   >       
  <html>  
        <head>  
              <title> WebForm2 </title>  
              <meta   name= "GENERATOR "   Content= "Microsoft   Visual   Studio   .NET   7.1 ">  
              <meta   name= "CODE_LANGUAGE "   Content= "C# ">  
              <meta   name=vs_defaultClientScript   content= "JavaScript ">  
              <meta   name=vs_targetSchema   content= "http://schemas.microsoft.com/intellisense/ie5 ">  
        </head>  
        <body   MS_POSITIONING= "GridLayout ">   	 
              <form   id= "Form1 "   method= "post "   runat= "server ">    
                 </form>   	 
        </body>  
  </html>      
 WebForm2.aspx.cs 
 -------------------------     
 using   System; 
 using   System.Collections; 
 using   System.ComponentModel; 
 using   System.Data; 
 using   System.Drawing; 
 using   System.Web; 
 using   System.Web.SessionState; 
 using   System.Web.UI; 
 using   System.Web.UI.WebControls; 
 using   System.Web.UI.HtmlControls;   
 namespace   PetShop.Web 
 { 
 	///    <summary>  
 	///   WebForm2   的摘要说明。 
 	///    </summary>  
 	public   class   WebForm2   :   System.Web.UI.Page 
 	{ 
 		private   void   Page_Load(object   sender,   System.EventArgs   e) 
 		{ 
 			//   在此处放置用户代码以初始化页面 
 		}   
 		#region   Web   窗体设计器生成的代码 
 		override   protected   void   OnInit(EventArgs   e) 
 		{ 
 			// 
 			//   CODEGEN:   该调用是   ASP.NET   Web   窗体设计器所必需的。 
 			// 
 			InitializeComponent(); 
 			base.OnInit(e); 
 		}  		 
 		///    <summary>  
 		///   设计器支持所需的方法   -   不要使用代码编辑器修改 
 		///   此方法的内容。 
 		///    </summary>  
 		private   void   InitializeComponent() 
 		{             
 			this.Load   +=   new   System.EventHandler(this.Page_Load); 
 		} 
 		#endregion 
 	} 
 }
------解决方案--------------------你需要编译以后执行,最简单的就是在VS中按F5执行,如果不编译在浏览器中直接敲地址是肯定会出错的