Clearing session variables when reset button is pressed

K

Kermit Piper

Hello,

How can you clear session variables when a reset button is pressed? I
thought I might be able to do something like:

<%
If request.form("Reset") = "Reset" then
Session("variable") = Null
%>

Is this correct, it isn't working right so is there a better way?

Thanks in advance,
KP
 
E

Evertjan.

Kermit Piper wrote on 18 mrt 2006 in
microsoft.public.inetserver.asp.general:
Hello,

How can you clear session variables when a reset button is pressed? I
thought I might be able to do something like:

<%
If request.form("Reset") = "Reset" then
Session("variable") = Null
%>

Is this correct, it isn't working right so is there a better way?

No it is not:

[A type=reset button does not submit]

Multiline "if .. then" statements need an "end if"

Session() can just be reset to empty string,
because a non existing one can be tested as such.
 
K

Kermit Piper

Hello,

In response to this response:

No it is not:

[A type=reset button does not submit] (WHAT DOES THIS MEAN!!!???? SO
WHAT DO I NEED TO DO? USE AN INPUT TYPE = BUTTON? THEN HOW DO I FIRE
THIS, FROM A JAVASCRIPT?)

Multiline "if .. then" statements need an "end if" (OK, JUST LEFT IT
OUT OF THE ORIGINAL SNIPPET)

Session() can just be reset to empty string,
because a non existing one can be tested as such. (OK)

Thanks,
KP

Evertjan. said:
Kermit Piper wrote on 18 mrt 2006 in
microsoft.public.inetserver.asp.general:
Hello,

How can you clear session variables when a reset button is pressed? I
thought I might be able to do something like:

<%
If request.form("Reset") = "Reset" then
Session("variable") = Null
%>

Is this correct, it isn't working right so is there a better way?

No it is not:

[A type=reset button does not submit]

Multiline "if .. then" statements need an "end if"

Session() can just be reset to empty string,
because a non existing one can be tested as such.
 
E

Evertjan.

Kermit Piper wrote on 18 mrt 2006 in
microsoft.public.inetserver.asp.general:
[A type=reset button does not submit] (WHAT DOES THIS MEAN!!!???? SO
WHAT DO I NEED TO DO? USE AN INPUT TYPE = BUTTON? THEN HOW DO I FIRE
THIS, FROM A JAVASCRIPT?)

Multiline "if .. then" statements need an "end if" (OK, JUST LEFT IT
OUT OF THE ORIGINAL SNIPPET)

[please do not toppost on usenet]

[please repair your caps-lock key]
 
F

Fishman

Or this will work also......

Session.Contents.Remove("variable")

"variable" is of course whatever you named it to beging with.
 
M

Mike Brind

Kermit said:
Hello,

In response to this response:

No it is not:

[A type=reset button does not submit] (WHAT DOES THIS MEAN!!!???? SO
WHAT DO I NEED TO DO? USE AN INPUT TYPE = BUTTON? THEN HOW DO I FIRE
THIS, FROM A JAVASCRIPT?)

Multiline "if .. then" statements need an "end if" (OK, JUST LEFT IT
OUT OF THE ORIGINAL SNIPPET)

Typing in capital letters in Usenet (and email, for that matter) is the
equivalent of shouting. No one here is obliged to answer your
questions, or provide help. Shouting (using capitals) will reduce your
chances of obtaining a helpful response considerably.
 
K

Kermit Piper

Mike and Evertran:

If I was to get an understandable response to my question in the first
place maybe I wouldn't have to shout. It's very frustrating when I try
to help people, but when I ask for help I get responses that are either
very lame or hard to decipher. Oh, and don't be so sensitive to
"shouting". I think you're both acting like prissy little girls. In
other words, grow up, get over it and join the real world!

Good Night and Goodluck,
KP

Mike said:
Kermit said:
Hello,

In response to this response:

No it is not:

[A type=reset button does not submit] (WHAT DOES THIS MEAN!!!???? SO
WHAT DO I NEED TO DO? USE AN INPUT TYPE = BUTTON? THEN HOW DO I FIRE
THIS, FROM A JAVASCRIPT?)

Multiline "if .. then" statements need an "end if" (OK, JUST LEFT IT
OUT OF THE ORIGINAL SNIPPET)

Typing in capital letters in Usenet (and email, for that matter) is the
equivalent of shouting. No one here is obliged to answer your
questions, or provide help. Shouting (using capitals) will reduce your
chances of obtaining a helpful response considerably.
 
B

Bob Lehmann

If I was to get an understandable response to my question
The answer you got was very understandable, not lame and needed no
deciphering. I would suggest that your question was lame.
How can you clear session variables when a reset button is pressed?
You can't. A reset button only restores the current form's initial values.

You then provided code that will never run. But if it did you would get an
error because it has a bug.I thought I might be able to do something like:

<%
If request.form("Reset") = "Reset" then
Session("variable") = Null
%>

Why did you think that? A reset button won't clear session vars since it
doesn't <hint>submit</hint> the form to the server.

The mind readers here have the weekend off. Who was to know whether or not
your posted code was accurately typed from your source?
The bug was pointed out to you, and you responded nastily. If the code was
meant to demonstrate a problem, you should have posted the actual code.

So, scurry off now to read a basic HTML manual to find out which type input
you need to <hint>submit</hint> a form to the server.

You may also want to work on your manners. Emphasising your ignorance of the
task at hand, by being rude to those trying to help you, is not a good
strategy.

What I've provided, is probably the most help you're going to get now.

Good Night and Goodluck,
Bob Lehmann


Kermit Piper said:
Mike and Evertran:

If I was to get an understandable response to my question in the first
place maybe I wouldn't have to shout. It's very frustrating when I try
to help people, but when I ask for help I get responses that are either
very lame or hard to decipher. Oh, and don't be so sensitive to
"shouting". I think you're both acting like prissy little girls. In
other words, grow up, get over it and join the real world!

Good Night and Goodluck,
KP

Mike said:
Kermit said:
Hello,

In response to this response:

No it is not:

[A type=reset button does not submit] (WHAT DOES THIS MEAN!!!???? SO
WHAT DO I NEED TO DO? USE AN INPUT TYPE = BUTTON? THEN HOW DO I FIRE
THIS, FROM A JAVASCRIPT?)

Multiline "if .. then" statements need an "end if" (OK, JUST LEFT IT
OUT OF THE ORIGINAL SNIPPET)

Typing in capital letters in Usenet (and email, for that matter) is the
equivalent of shouting. No one here is obliged to answer your
questions, or provide help. Shouting (using capitals) will reduce your
chances of obtaining a helpful response considerably.
 

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,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top