ASP href正在重置会话变量,为什么?救命 [英] ASP href is resetting session variable, why?? HELP

查看:56
本文介绍了ASP href正在重置会话变量,为什么?救命的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这一行,此时Session(Login)的值为1:


Response.Write"< a href =" &安培;请求(script_name)& _

"?action = show& o =" &安培; rsCustOrders(" OrderID")& _

">" &安培; rsCustOrders(" OrderID")& "< / a>"


点击它后,它会刷新页面并转到以下

部分,并以某种方式显示值会话(登录)为0,因此,它在ELSE陷阱中结束




如果会话(登录)= 1然后

如果修剪(请求(o))<> ""然后

会话(" OrderID")=请求(" o")

Response.Buffer = True

Response.Clear

Response.Redirect请求(" script_name")& _

"?action = viewinfo& ordnum =" &安培;会话(OrderID)

结束如果

否则

...等等等等等等b $ b结束如果


有人可以告诉我为什么Session(Login)休息为0? global.asa中的初始值

设置为0.我无法弄明白为什么它会重置它。

但是,如果我不使用< a href,它不会重置这个?

解决方案

Bobby写道:

我有这一行,此时Session(Login)的值为1:

Response.Write"< a href =" &安培;请求(script_name)& _
"?action = show& o =" &安培; rsCustOrders(" OrderID")& _
">" &安培; rsCustOrders(" OrderID")& "< / a>"

点击它后,它会刷新页面并转到以下
部分,以及某种方式的会话值(登录)为0,因此,它在ELSE陷阱中结束

如果Session(Login)= 1则
如果Trim(请求(o)) )<> ""然后
会话(OrderID)=请求(o)
Response.Buffer = True
Response.Clear
Response.Redirect Request(" script_name") &安培; _
"?action = viewinfo& ordnum =" &安培;会话(OrderID)
结束如果
其他
...等等等等

有人可以告诉我为什么会话("登录)休息为0? global.asa中的初始值
为此设置为0.我无法弄清楚为什么它会重置它。
但是,如果我不使用<一个href,它没有重置这个?




我认为你的新闻组错了。这个地方是

JavaScript,而不是ASP。


如果您的问题与您的ASP页面生成的JavaScript有关,

然后发布客户收到的任何内容,而不是生成它的ASP代码

。换句话说,是什么:


< a href =" &安培;请求(script_name)& _

"?action = show& o =" &安培; rsCustOrders(" OrderID")& _

">" &安培; rsCustOrders(" OrderID")& < / a>


实际上看起来像在客户端?


-

Zif


是的,我知道这是我的JS新闻组,我不知道要发布哪个ASP组。

当你把鼠标移到OrderID,它看起来像这样:
http://www.mytestserver.com/vueorder...der&ordnum=146

当您点击超链接时,它会进入ELSE陷阱''原因

会话变量现在设置为0.我怎么知道我的会话变量

值,我添加了一个包含文件,循环通过会话

变量集合。


Bobby写道:

是的,我知道这是我的JS新闻组,我不知道哪个ASP小组发布。


嗯。任何microsoft.public都有点烦人,但是


microsoft.public.inetserver.asp.general


可能适合。

当您将鼠标移到OrderID时,它看起来像这样:
http://www.mytestserver.com/vueorder...der&ordnum=146



[... ]


点击链接只会给出404消息...


-

Zif


I have this line, at this time the value of Session("Login") is 1:

Response.Write "<a href=" & Request("script_name") & _
"?action=show&o=" & rsCustOrders("OrderID") & _
">" & rsCustOrders("OrderID") & "</a>"

Once you click on it, it refreshes the page and goes to the following
section, and somehow the value of Session("Login") is 0, hence, it ends
up in the ELSE trap:

If Session("Login") = 1 Then
If Trim(Request("o")) <> "" Then
Session("OrderID") = Request("o")
Response.Buffer = True
Response.Clear
Response.Redirect Request("script_name") & _
"?action=viewinfo&ordnum=" & Session("OrderID")
End If
Else
... blah blah
End If

Can someone tell me why Session("Login") is rest to 0? Initial value
in global.asa for this is set to 0. I can''t figure it out why it would
reset it.
However, if I DO NOT use "<a href", it does not reset this?

解决方案

Bobby wrote:

I have this line, at this time the value of Session("Login") is 1:

Response.Write "<a href=" & Request("script_name") & _
"?action=show&o=" & rsCustOrders("OrderID") & _
">" & rsCustOrders("OrderID") & "</a>"

Once you click on it, it refreshes the page and goes to the following
section, and somehow the value of Session("Login") is 0, hence, it ends
up in the ELSE trap:

If Session("Login") = 1 Then
If Trim(Request("o")) <> "" Then
Session("OrderID") = Request("o")
Response.Buffer = True
Response.Clear
Response.Redirect Request("script_name") & _
"?action=viewinfo&ordnum=" & Session("OrderID")
End If
Else
... blah blah
End If

Can someone tell me why Session("Login") is rest to 0? Initial value
in global.asa for this is set to 0. I can''t figure it out why it would
reset it.
However, if I DO NOT use "<a href", it does not reset this?



I think you have the wrong newsgroup. This place is for
JavaScript, not ASP.

If your issue is with the JavaScript generated by your ASP page,
then post whatever is received by the client, not the ASP code
that generates it. In other words, what does:

<a href=" & Request("script_name") & _
"?action=show&o=" & rsCustOrders("OrderID") & _
">" & rsCustOrders("OrderID") & "</a>

actually look like at the client?

--
Zif


Yes, I know this i JS newsgroup, I didn''t know which ASP group to post.
When you bring the mouse over to the OrderID, it looks like this:
http://www.mytestserver.com/vueorder...der&ordnum=146.
When you click on the hyperlink, it then goes into the ELSE trap ''cause
session variable now is set to 0. How I know my session variable
values, I added an include file, that cycles through the session
variable collection.


Bobby wrote:

Yes, I know this i JS newsgroup, I didn''t know which ASP group to post.
Hmm. Anything microsoft.public is kinda antsy, but

microsoft.public.inetserver.asp.general

may suit.
When you bring the mouse over to the OrderID, it looks like this:
http://www.mytestserver.com/vueorder...der&ordnum=146.


[...]

Clicking on your link just gives a 404 message...

--
Zif


这篇关于ASP href正在重置会话变量,为什么?救命的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆