weird problem with session object

K

keyser soze

hi,
i have an asp page,
in which i put a "response.write" for debug

*<%= session("x") %>*
<%
session("x")= "222"
%>

now, entering the page with session("x")= "111"
the code should "response" : *111*
but it produce : *222*

seems that it send "111" to the buffer
but, later, overwrite with "222"

i can't reproduce it in other page...
but i could send the entire code
for you to read

thanks!
regards,
ks
 
A

Anthony Jones

keyser soze said:
hi,
i have an asp page,
in which i put a "response.write" for debug

*<%= session("x") %>*
<%
session("x")= "222"
%>

now, entering the page with session("x")= "111"
the code should "response" : *111*
but it produce : *222*

seems that it send "111" to the buffer
but, later, overwrite with "222"

i can't reproduce it in other page...
but i could send the entire code
for you to read

The only way to overwrite whats already been sent to the buffer is to clear
it and start writing again.

One possibility is the page is being re-requested so the new value is seen.

Another possibility is that you haven't shown all the relevant code and
something else is changing the value. For example, does your real page mix
script languages? The order in which script blocks execute is a little less
than intuative in such a case.

Does the page use includes?
 
K

keyser soze

hello,
thanks for reply
problem solved
when i submit via a "input type submit" does not work
but if i submit via "input type BUTTON" it work
really strange behavior
unfortunatelly i can't reproduce it in a smaller code
i can't send the entire code with all the includes
to this news... but, thanks for the support

i think the problem is like you suggest :
"""| One possibility is the page is being re-requested so the new value is seen."""
because the "type submit"

bye
ks



"Anthony Jones" <[email protected]> escribió en el mensaje
| | > hi,
| > i have an asp page,
| > in which i put a "response.write" for debug
| >
| > *<%= session("x") %>*
| > <%
| > session("x")= "222"
| > %>
| >
| > now, entering the page with session("x")= "111"
| > the code should "response" : *111*
| > but it produce : *222*
| >
| > seems that it send "111" to the buffer
| > but, later, overwrite with "222"
| >
| > i can't reproduce it in other page...
| > but i could send the entire code
| > for you to read
| >
|
| The only way to overwrite whats already been sent to the buffer is to clear
| it and start writing again.
|
| One possibility is the page is being re-requested so the new value is seen.
|
| Another possibility is that you haven't shown all the relevant code and
| something else is changing the value. For example, does your real page mix
| script languages? The order in which script blocks execute is a little less
| than intuative in such a case.
|
| Does the page use includes?
|
|
|
| --
| Anthony Jones - MVP ASP/ASP.NET
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top