<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
</head>
<body>
<%
Response.Write("Hello World")
%>
tttttttttttttt
</body>
</html>
以上是我用DreamWeaver写显示Hello World的简单程序,但是Hello World显示不出来,仅仅能显示ttttttttttttt。
这段程序我是以aspx保存的,在IE中以http://127.0.0.1/sunkaiasp/hao/01.aspx打开的,在IIS中是存储在C:\Inetpub\wwwroot\sunkaiasp\hao目录下的,为什么Response.Write显示不出来呢。
请高手帮忙,谢谢了。

解决方案 »

  1.   

    lz以前是搞ASP得吧....
    asp.net一般不推荐直接把代码前在代码里面 如果实在要嵌在代码里要有一个runat=server的form<%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>无标题页</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <%Response.Write("Hello1");  %>
        </div>
        </form>
    </body>
    </html>
      

  2.   

    lz为什么要在body部分写呢
    你可以在cs文件里写啊
    而且你写
    <%
    Response.Write("Hello World")
    %>
    这个语句,你确定可以这样吗?
    如果是在cs文件中,那就直接写Response.Write("Hello World")
      

  3.   

    高手,我把您的代码直接粘贴到DreamWeaver中显示的只有一个表单,用IE运行什么都没有,是空的阿。为什么阿。我ASP.net确实刚接触,ASP会些,但即使是ASP.net应该也可能像我那么写吧?