void Page_Load(Object Source,EventArgs E)
    {
      //if Page.IsPostBack 
      {
        lblMsg.Text="Hello World!";
      }
    }

解决方案 »

  1.   

    if(Page.IsPostBack)
    {
    lblMsg.Text="Hello World!";
    }
      

  2.   

    <form runat="server">
    Message:<input type="submit" value="OK" id="PressOK" unat="server"</form>
    ~~~~
    ------------------------------------
    unat="server"    ======>>>>   runat="server"================================================
          if Page.IsPostBack 
          {  ~~~~~~~~~~~~~~~
            lblMsg.Text="Hello World!";
          }
    ----------------------
          if (Page.IsPostBack) 
          {
            lblMsg.Text="Hello World!";
          }
      

  3.   

    if(!Page.IsPostBack) 
    {
       lblMsg.Text="Hello World!";
    }
      

  4.   

    if(!Page.IsPostBack)
    {
    lblMsg.Text="Hello World!";
    }
      

  5.   

    if (!Page.IsPostBack) 
          {
            lblMsg.Text="Hello World!";
          }
      

  6.   

    <%@Page Language="C#" debug="true"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>第一个ASP.NET程序</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </head>
    <script language="C#" runat="server">
        void Page_Load(Object Source,EventArgs E)
        {
          if(!Page.IsPostBack) 
          {
            lblMsg.Text="Hello World!";
          }
        }
    </script>
    <body>
    <asp:label runat="server" id="lblMsg"/>
    <form runat="server">
    Message:<input type="submit" value="OK" id="PressOK" unat="server"</form>
    </body>
    </html>
      

  7.   

        void Page_Load(Object Source,EventArgs E)
        {
          if(!Page.IsPostBack) 
          {
            lblMsg.Text="Hello World!";
          }
        }