<% @Page language="cs" AutoEventWrieup="true" %>
<script runat="server">
Private void Page_Load(object sender,System.EventArgs e)
{
 Response.write("hello");
 
 if (!isPostBack)
 {
   Lable1.Text=System.DateTime.Now.ToString("f");
  }
 }
 </script>
 
 <html>
 <title>探视</title>
 <body>
 <form runat="server">
 <asp:Label1 id="Label1" runat="server"/>
 </form>
 </body>
 </html>
   各位大哥提示的错误是:
Server Error in '/LshMyWebSite2/WebApplication34' Application.
--------------------------------------------------------------------------------Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The 'AutoEventWrieup' attribute is not supported by the 'page' directive.Source Error: 
Line 1:  <% @Page language="cs" AutoEventWrieup="true" %>
Line 2:  <script runat="server">
Line 3:  Private void Page_Load(object sender,System.EventArgs e)
 Source File: F:\LshMyWebSite2\WebApplication34\WebForm1.aspx    Line: 1 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573 
请教各位大哥,我应该改哪里呢?
还有一个问题是:
当我从 html 返回到 design 时,lable1 上显示
error creating control label1
各位大哥这又是什么原因呢?
谢谢各位大哥!

解决方案 »

  1.   

    <% @Page language="cs" AutoEventWrieup="true" %>
    拼错了AutoEventWireup
      

  2.   

    <asp:Label1 这个也错了
    ----------------------
    <asp:Label
      

  3.   

    非常感谢  fancyf 大哥:
    可是 现在这里又出现错误了~~<asp:Label1 id="Label1" runat="server"/>  //这一行有错误
    Server Error in '/LshMyWebSite2/WebApplication34' Application.
    --------------------------------------------------------------------------------Parser Error 
    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type System.Web.UI.WebControls.Label1 from assembly System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.Source Error: 
    Line 16:  <body>
    Line 17:  <form runat="server" ID="Form1">
    Line 18:  <asp:Label1 id="Label1" runat="server"/>
    Line 19:  </form>
    Line 20:  </body>
     Source File: F:\LshMyWebSite2\WebApplication34\WebForm1.aspx    Line: 18 
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573  fancyf 大哥我又错在哪里啊(我是没有放置 html 的 label1 控件的)
    谢谢  fancyf 和各位大哥!
      

  4.   

    <asp:Label1 id="Label1" runat="server"/>
    --------
    应该是这样吧:
    <asp:Label ID="Label1" Runat="Server"/>
      

  5.   

    楼主这个页面完全是手写的?建议用.net吧,会自动修正你很多错误的,代码没什么问题
      

  6.   

    谢谢各位大哥:
    还有一个错误Compilation Error 
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1519: Invalid token 'void' in class, struct, or interface member declarationSource Error: Line 1:  <% @Page language="cs" AutoEventWireup="true" %>
    Line 2:  <script runat="server">
    Line 3:  Private void Page_Load(object sender,System.EventArgs e)
    Line 4:  {
    Line 5:   Response.write("hello");
     Source File: http://localhost/LshMyWebSite2/WebApplication34/WebForm1.aspx    Line: 3 这里我又是错误在哪里啊?谢谢各位大哥!
      

  7.   

    谢谢各位大哥的意见,小弟刚开始学 ASP.NET现在我写在这里面,是为了熟悉 aspx ,以后我会用 .net的!
    现在是可以运行了,不过还有两个问题向各位大哥请教问题1
      

  8.   

    谢谢各位大哥的意见,小弟刚开始学 ASP.NET(以后请各位大哥多指教)现在我写在这里面,是为了熟悉 aspx ,以后我会用 .net的!
    现在是可以运行了,不过还有两个问题向各位大哥请教问题1:
    !isPostBack  是什么意思问题2:
    像我上面那段程序,它是从哪里开始执行的,是从
    private void Page_Load(object sender,System.EventArgs e)
    {
     Response.Write("hello");
     
     if (!IsPostBack)
     {
       Label1.Text=System.DateTime.Now.ToString("f");
      }
     }还是从
    <html>
     <title>探视</title>
     <body>
     <form runat="server" ID="Form1">
     <asp:Label id="Label1" runat="server"/>
     </form>
     </body>
     </html>
    如果从
    private void Page_Load(object sender,System.EventArgs e)
    {
     Response.Write("hello");
     
     if (!IsPostBack)
     {
       Label1.Text=System.DateTime.Now.ToString("f");
      }
     }
    的话
    那么它的  Label1 是从哪里来呢/
    真是辛苦各位大哥了!
      

  9.   

    建议楼主先用vs.net 等熟悉了再用笔记本吧!
      

  10.   

    谢谢  fancyf大哥 和 powerllr大哥的忠告~!!!!