ASP呈现诡异 [英] ASP rendering wierdness
问题描述
当我尝试使用ASP生成一些非常基本的HTML时,我遇到了一些(可重现的)wierdness。查看以下(基本)ASP代码:
============================ ===============
<%选项明确
Const STRING_1 =" / admin / UploadProgress2。 asp"
Const STRING_A =" AXFFile" %>
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< title> Untitled< / title>
< / head>
< body> ;
<%= STRING_A%> .Server ="<%= Request.ServerVariables(" SERVER_NAME")%>"
< %= STRING_A%> .Port =<%= Request.ServerVariables(" SERVER_PORT")%>
<%= STRING_A%> .ObjectName ="<%= STRING_1%>"
< / body>
< / html>
========== =================================
问题是,当我跑时ASP页面并查看HTML源代码
生成的
,我得到以下内容:
============ ===============================
<!DOCTYPE HTML PUBLIC" ; - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< ; title> Untitled< / title>
< / head>
< body>
AXFFile.Server =" www.nbsc .com"
AXFFile.Port = 80AXFFile.ObjectName =" /admin/UploadProgress2.asp"
< / body>
< ; / html>
====================================== =====
为什么第12行(<%= STRING_A%> .Port =
<%= Request.ServerVariables(") ; SERVER_PORT")%>)和13
(<%= STRING_A%> .ObjectName ="<%= STRING_1%>")在
HTML?任何人都可以重现这个问题,如果有的话,你有没有想到为什么会发生这种情况?我总是可以通过在每行的末尾添加vbcrlf
来解决它,但我宁愿不解决它...........
非常感谢任何帮助.....提前感谢!
- = Tek Boy = -
如果您想要回车,请使用< BR>。
我无法重现您的问题(这一切都出现在一行),但请
不要将纯文本字符与HTML字符混淆......
-
http://www.aspfaq.com/
(反向回复地址。)
Tek Boy <已经**************** @ hotmail.com>在消息中写道
新闻:#8 ************** @ TK2MSFTNGP11.phx.gbl ...我已经当我尝试
使用ASP生成一些非常基本的HTML时,我遇到了一些(可重现的)wierdness。查看以下(基本)ASP代码:
================================ ===========
<%Option Explicit
Const STRING_1 =" /admin/UploadProgress2.asp"
Const STRING_A =" AXFFile" ; %>
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< title>无标题< / title>
< / head>
< body>
<%= STRING_A%> .Server ="<%=请求。 ServerVariables(" SERVER_NAME")%>"
<%= STRING_A%> .Port =<%= Request.ServerVariables(" SERVER_PORT")%>
<% = STRING_A%> .ObjectName ="<%= STRING_1%>"
< / body>
< / html>
======== ===================================
问题是,当我"运行" ASP页面并查看生成的HTML源
代码,我得到以下内容:
==================== =======================
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional / / EN">
< html>
< head>
< title> Untitled< / title>
< / head>
< body> ;
AXFFile.Server =" www.nbsc.com"
AXFFile.Port = 80AXFFile.ObjectName =" /admin/UploadProgress2.asp"
< / body>
< / html>
======================================== ===
为什么第12行(<%= STRING_A%> .Port =
<%= Request.ServerVariables(" SERVER_PORT")%>)和13
(<%= STRING_A%> .ObjectName ="<%= STRING_1%>")在
HTML中显示为一行?任何人都可以重现这个问题,如果是这样,你有没有想到为什么会这样?我总是可以通过添加
" vbcrlf"来解决这个问题。到每一行的结尾,但我宁愿不解决它...........
任何帮助将不胜感激.....在此先感谢!
- = Tek Boy = -
转载! W2K SP3服务器。 WS2003上的行为相同。
我无法解释。这有点奇怪!如果我在行尾添加一些其他
字符,则所有换行符都会出现在HTML中。
<%Option Explicit%> ;
<%
Const STRING_1 =" /admin/UploadProgress2.asp"
Const STRING_A =" AXFFile"
%>
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< title> Untitled< / title>
< / head>
< body>
<%= STRING_A%> .Server ="<%= Request.ServerVariables(" SERVER_NAME")%>"
<%= STRING_A%> .Port =<%= Request.ServerVariables(" SERVER_PORT")%>
<! - - >
<%= STRING_A%> .ObjectName ="<%= STRING_1%>"
< / body>
< / html>
换行符显示出来。但是,如果我删除了<! - - >,他们就不会支付
。
雷在工作
Tek Boy <已经**************** @ hotmail.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...我'当我尝试使用ASP生成一些非常基本的HTML时,我一直在体验一些(可重现的)wierdness。查看以下(基本)ASP代码:
================================ ===========
<%Option Explicit
Const STRING_1 =" /admin/UploadProgress2.asp"
Const STRING_A =" AXFFile" ; %>
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< title>无标题< / title>
< / head>
< body>
<%= STRING_A%> .Server ="<%=请求。 ServerVariables(" SERVER_NAME")%>"
<%= STRING_A%> .Port =<%= Request.ServerVariables(" SERVER_PORT")%>
<% = STRING_A%> .ObjectName ="<%= STRING_1%>"
< / body>
< / html>
======== ===================================
问题是,当我"运行" ASP页面和查看HTML源代码
生成的代码,我得到以下内容:
================ ===========================
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< title> Untitled< / title>
< / head>
< body>
AXFFile.Server =" www.nbsc.com"
AXFFile.Port = 80AXFFile.ObjectName =" /admin/UploadProgress2.asp"
< / body> ;
< / html>
==================================== =======
为什么第12行(<%= STRING_A%> .Port =
<%= Request.ServerVariables(" SERVER_PORT")%> ;)和13
(<%= STRING_A%> .ObjectName ="<%= STRING_1%>")在
HTML中显示为一行?任何人都可以重现这个问题,如果是这样,你有没有想到为什么会这样?我总是可以通过在每行的末尾添加
vbcrlf
来解决它,但我宁愿不解决它...........
任何帮助都将不胜感激.....提前感谢!
- = Tek Boy = -
他在谈论的是实际的HTML源代码是如何出现的。 HTML
文件具有:
<%= STRING_A%> .Server ="<%= Request.ServerVariables(" SERVER_NAME")%>
<%= STRING_A%> .Port =<%= Request.ServerVariables(" SERVER_PORT")%>
<%= STRING_A %> .ObjectName ="<%= STRING_1%>"
应显示为
AXFFile.Server = " oldharleyweb"
AXFFile.Port = 80
AXFFile.ObjectName =" /admin/UploadProgress2.asp"
在做视图源时。但相反,它显示为:
AXFFile.Server =" oldharleyweb"
AXFFile.Port = 80AXFFile.ObjectName =" / admin / UploadProgress2。 asp"
Ray在工作中
Aaron [SQL Server MVP]" < TE ***** @ dnartreb.noraa>在消息中写道
新闻:O7 ************** @ TK2MSFTNGP14.phx.gbl ...如果你想要一辆马车返回,使用< BR>。
我无法重现您的问题(这一切都出现在一行),但请不要将纯文本字符与HTML字符混淆......
http:// www。 aspfaq.com/
(反向回复地址。)
Tek Boy <已经**************** @ hotmail.com>在消息中写道
新闻:#8 ************** @ TK2MSFTNGP11.phx.gbl ...我一直在体验一些(当我尝试
使用ASP生成一些非常基本的HTML时,可重现性。查看以下(基本)ASP
代码:
============================ ===============
<%Option Explicit
Const STRING_1 =" /admin/UploadProgress2.asp"
Const STRING_A =AXFFile %>
<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.0 Transitional // EN">
< html>
< head>
< title> Untitled< / title>
< / head>
< body>
<%= S
I''ve been experiencing some (reproducable) wierdness when I try to generate
some very basic HTML using ASP. Check out the following (basic) ASP code:
===========================================
<% Option Explicit
Const STRING_1 = "/admin/UploadProgress2.asp"
Const STRING_A = "AXFFile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%=STRING_A%>.Server = "<%=Request.ServerVariables("SERVER_NAME")%>"
<%=STRING_A%>.Port = <%=Request.ServerVariables("SERVER_PORT")%>
<%=STRING_A%>.ObjectName = "<%=STRING_1%>"
</body>
</html>
===========================================
The problem is that, when I "run" the ASP page and view the HTML source code
that is generated, I get the following:
===========================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
AXFFile.Server = "www.nbsc.com"
AXFFile.Port = 80AXFFile.ObjectName = "/admin/UploadProgress2.asp"
</body>
</html>
===========================================
Why do lines 12 (<%=STRING_A%>.Port =
<%=Request.ServerVariables("SERVER_PORT")%>) and 13
(<%=STRING_A%>.ObjectName = "<%=STRING_1%>") appear as a single line in
HTML? Can anybody else reproduce this problem, and if so, do you have any
idea why this is happening? I can always work around it by adding "vbcrlf"
to the end of each line, but I''d rather not work around it...........
Any help would be greatly appreciated..... thanks in advance!
-= Tek Boy =-
If you want a carriage return, use <BR>.
I couldn''t reproduce your issue (it all appears on one line), but please
don''t confuse plain text characters with HTML characters...
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Tek Boy" <ve****************@hotmail.com> wrote in message
news:#8**************@TK2MSFTNGP11.phx.gbl...I''ve been experiencing some (reproducable) wierdness when I try to generate some very basic HTML using ASP. Check out the following (basic) ASP code:
===========================================
<% Option Explicit
Const STRING_1 = "/admin/UploadProgress2.asp"
Const STRING_A = "AXFFile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%=STRING_A%>.Server = "<%=Request.ServerVariables("SERVER_NAME")%>"
<%=STRING_A%>.Port = <%=Request.ServerVariables("SERVER_PORT")%>
<%=STRING_A%>.ObjectName = "<%=STRING_1%>"
</body>
</html>
===========================================
The problem is that, when I "run" the ASP page and view the HTML source code that is generated, I get the following:
===========================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
AXFFile.Server = "www.nbsc.com"
AXFFile.Port = 80AXFFile.ObjectName = "/admin/UploadProgress2.asp"
</body>
</html>
===========================================
Why do lines 12 (<%=STRING_A%>.Port =
<%=Request.ServerVariables("SERVER_PORT")%>) and 13
(<%=STRING_A%>.ObjectName = "<%=STRING_1%>") appear as a single line in
HTML? Can anybody else reproduce this problem, and if so, do you have any
idea why this is happening? I can always work around it by adding "vbcrlf" to the end of each line, but I''d rather not work around it...........
Any help would be greatly appreciated..... thanks in advance!
-= Tek Boy =-
Reproduced! W2K SP3 server. Same behavior on a WS2003.
I can''t explain it. That is a bit bizarre! If I throw in some other
characters at the end of the line, all the line breaks appear in the HTML.
<% Option Explicit %>
<%
Const STRING_1 = "/admin/UploadProgress2.asp"
Const STRING_A = "AXFFile"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%=STRING_A%>.Server = "<%=Request.ServerVariables("SERVER_NAME")%>"
<%=STRING_A%>.Port = <%=Request.ServerVariables("SERVER_PORT")%>
<!-- -->
<%=STRING_A%>.ObjectName = "<%=STRING_1%>"
</body>
</html>
The line breaks show up with that. But if I remove the <!-- -->, they do
not.
Ray at work
"Tek Boy" <ve****************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...I''ve been experiencing some (reproducable) wierdness when I try to
generate
some very basic HTML using ASP. Check out the following (basic) ASP code:
===========================================
<% Option Explicit
Const STRING_1 = "/admin/UploadProgress2.asp"
Const STRING_A = "AXFFile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%=STRING_A%>.Server = "<%=Request.ServerVariables("SERVER_NAME")%>"
<%=STRING_A%>.Port = <%=Request.ServerVariables("SERVER_PORT")%>
<%=STRING_A%>.ObjectName = "<%=STRING_1%>"
</body>
</html>
===========================================
The problem is that, when I "run" the ASP page and view the HTML source
code
that is generated, I get the following:
===========================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
AXFFile.Server = "www.nbsc.com"
AXFFile.Port = 80AXFFile.ObjectName = "/admin/UploadProgress2.asp"
</body>
</html>
===========================================
Why do lines 12 (<%=STRING_A%>.Port =
<%=Request.ServerVariables("SERVER_PORT")%>) and 13
(<%=STRING_A%>.ObjectName = "<%=STRING_1%>") appear as a single line in
HTML? Can anybody else reproduce this problem, and if so, do you have any
idea why this is happening? I can always work around it by adding
"vbcrlf"
to the end of each line, but I''d rather not work around it...........
Any help would be greatly appreciated..... thanks in advance!
-= Tek Boy =-
What he was talking about is how the actual HTML source appears. The HTML
file has:
<%=STRING_A%>.Server = "<%=Request.ServerVariables("SERVER_NAME")%>"
<%=STRING_A%>.Port = <%=Request.ServerVariables("SERVER_PORT")%>
<%=STRING_A%>.ObjectName = "<%=STRING_1%>"
which should appear as
AXFFile.Server = "oldharleyweb"
AXFFile.Port = 80
AXFFile.ObjectName = "/admin/UploadProgress2.asp"
when doing a view source. But instead, it appears as:
AXFFile.Server = "oldharleyweb"
AXFFile.Port = 80AXFFile.ObjectName = "/admin/UploadProgress2.asp"
Ray at work
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:O7**************@TK2MSFTNGP14.phx.gbl...If you want a carriage return, use <BR>.
I couldn''t reproduce your issue (it all appears on one line), but please
don''t confuse plain text characters with HTML characters...
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Tek Boy" <ve****************@hotmail.com> wrote in message
news:#8**************@TK2MSFTNGP11.phx.gbl...I''ve been experiencing some (reproducable) wierdness when I try to
generatesome very basic HTML using ASP. Check out the following (basic) ASP
code:
===========================================
<% Option Explicit
Const STRING_1 = "/admin/UploadProgress2.asp"
Const STRING_A = "AXFFile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%=S
这篇关于ASP呈现诡异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!