
ASP问题,Session变量传递不过去
ASP用javascript写,在one.asp中的代码如下<%@language="javascript"%><html><head></head><body><for...
ASP用javascript写,在one.asp中的代码如下
<%@ language="javascript" %>
<html>
<head></head>
<body>
<form method="post" action="two.asp">
<input name="ip"><input type="submit" value="查询">
</form>
<%Session("ip")="a"%>
</body>
</html>
在同一目录下的two.asp中响应表单的输入,如下
<%@ language="javascript" %>
<html>
<head></head>
<body>
处理表单的代码
<%
Response.Write("Session变量是"+Session("ip"))
%>
</body>
</html>
结果显示Session变量是undefined为什么Session变量传递不过去? 展开
<%@ language="javascript" %>
<html>
<head></head>
<body>
<form method="post" action="two.asp">
<input name="ip"><input type="submit" value="查询">
</form>
<%Session("ip")="a"%>
</body>
</html>
在同一目录下的two.asp中响应表单的输入,如下
<%@ language="javascript" %>
<html>
<head></head>
<body>
处理表单的代码
<%
Response.Write("Session变量是"+Session("ip"))
%>
</body>
</html>
结果显示Session变量是undefined为什么Session变量传递不过去? 展开
3个回答
展开全部
Response.Write("Session变量是"+Session("ip")) 和 Response.Write("Session变量是"&Session("ip"))是都可以的
你再试试,按这个程序输出的结果是a,这个没错,你如果出现unfefined的问题可能是别的地方出错
但这个表单好像没有什么用处,除了按钮可转到另一页面
你再试试,按这个程序输出的结果是a,这个没错,你如果出现unfefined的问题可能是别的地方出错
但这个表单好像没有什么用处,除了按钮可转到另一页面
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询