Classic ASP showing variable

寵の児 提交于 2019-12-10 18:35:39

问题


I just want to show a result of a variable on a page and i am struggling

heres my code, the variable is in a table as you can see

thanks in advance

<tr><td><%
Dim sTest
sTest = "Monkey"
Response.Write("<p>" & sTest & "</p>")
%>
<p> This is Excel </p>
</td></tr>

回答1:


Save the below code as HelloWorld.asp. Open this page in a web browser. Tell us what you see.

(Don't put any html code or anything else)


<%
Dim sTest
sTest = "Hello World"
Response.Write(sTest)
Response.End
%>



回答2:


html code....
<p><%=sTest%></p>
html code....



回答3:


I tried your code in a .asp file and it seems to be working... What problem are you facing? I have added border=1 to your code to show the table border...

<html> <body> 
<% 
        Dim sTest 
        sTest= "TEXT" 
        response.write("<table border='1'><tr><td>") 
        response.write (sTest)
        response.write ("</td></tr></table>") 
%> 
</body> </html>



回答4:


I don't understant exactly your code (This is Excel? ,/tr>? ) but:

<%
Dim sTest
sTest= "TEXT"

response.write "<table><tr><td>"

response.write sTest

response.write "</td></tr></table>"
%>

Will write "TEXT" in the only cell of the table.

EDIT: He was using .htm as file extension.



来源:https://stackoverflow.com/questions/8340728/classic-asp-showing-variable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!