By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,460 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Clearing session variables when reset button is pressed

P: n/a
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

Mar 18 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 18 '06 #2

P: n/a
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. wrote:
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.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Mar 18 '06 #3

P: n/a
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]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 18 '06 #4

P: n/a
Or this will work also......

Session.Contents.Remove("variable")

"variable" is of course whatever you named it to beging with.
"Kermit Piper" <di***********@hotmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
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

Mar 18 '06 #5

P: n/a

Kermit Piper wrote:
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.

--
Mike Brind

Mar 18 '06 #6

P: n/a
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 Brind wrote:
Kermit Piper wrote:
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.

--
Mike Brind


Mar 19 '06 #7

P: n/a
> 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" <di***********@hotmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com... 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 Brind wrote:
Kermit Piper wrote:
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.

--
Mike Brind

Mar 19 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.