Clearing session variables when reset button is pressed

Clearing session variables when reset button is pressed

am 18.03.2006 08:57:56 von 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

Re: Clearing session variables when reset button is pressed

am 18.03.2006 10:37:28 von exjxw.hannivoort

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)

Re: Clearing session variables when reset button is pressed

am 18.03.2006 19:41:14 von 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. 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)

Re: Clearing session variables when reset button is pressed

am 18.03.2006 19:46:14 von exjxw.hannivoort

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)

Re: Clearing session variables when reset button is pressed

am 18.03.2006 20:30:30 von fishman

Or this will work also......

Session.Contents.Remove("variable")

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


"Kermit Piper" wrote in message
news:1142668676.838466.312900@v46g2000cwv.googlegroups.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
>

Re: Clearing session variables when reset button is pressed

am 18.03.2006 22:21:38 von Mike Brind

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

Re: Clearing session variables when reset button is pressed

am 19.03.2006 20:47:33 von 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 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

Re: Clearing session variables when reset button is pressed

am 19.03.2006 21:49:54 von 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 submit 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 submit 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" wrote in message
news:1142797653.415323.219010@i40g2000cwc.googlegroups.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
>