追加!!!asp中include的作用!!!
来源:百度知道 编辑:UC知道 时间:2024/05/28 02:58:39
a.asp include b.asp
a、b两个文件中的变量可以相互使用么?
比如在b中的代码(此代码不在某方法中):
dim xx
if membername="zhangsan" then xx=1
a中没有声明xx,但想使用xx:
if xx=1 then call main()
这样为什么行不通???请各位帮忙,有追加
a、b两个文件中的变量可以相互使用么?
比如在b中的代码(此代码不在某方法中):
dim xx
if membername="zhangsan" then xx=1
a中没有声明xx,但想使用xx:
if xx=1 then call main()
这样为什么行不通???请各位帮忙,有追加
file:a.asp
<%
a = 10
%>
<br />
<%="before include a=" & a%>
<!--#include file="b.asp"-->
<%="after include a=" & a%>
file:b.asp
<br />
<%="inner b:a=" & a%>
<br />
<%
a=100
%>
<br />
<%="inner b changed:a=" & a%>
<br />
得出的结果是:
before include a=10
inner b:a=10
inner b changed:a=100
after include a=100
如果:
file:a.asp
<br />
<%="before include a=" & a%>
<!--#include file="b.asp"-->
<%="after include a=" & a%>
file:b.asp
<%
a=10
%>
<br />
<%="inner b:a=" & a%>
<br />
<%
a=100
%>
<br />
<%="inner b changed:a=" & a%>
<br /><