yasuru
04-03-2004, 03:03 AM
How can I abandon session and reset form values Using a button. thanks
|
Click to See Complete Forum and Search --> : Abandon session using button yasuru 04-03-2004, 03:03 AM How can I abandon session and reset form values Using a button. thanks PeOfEo 04-03-2004, 03:12 AM session("var")= "" or session.abandon. Just fire it on button click. yasuru 04-03-2004, 03:28 AM Thanks for instant reply, I'll be greatful to you if you help me with the code, I mean how to put this in <input> tag. Thanks again. PeOfEo 04-03-2004, 04:02 AM You do not put it in an input tag. I really can't help you with the code for asp classic because I do not use asp classic, I use asp.net. I can phsudo code it for you, I could probably give you some vbscript that would work, but I do not want to be giving people code to stuff when it is not my area because there is a pretty good chance it will not work. buntine 04-03-2004, 05:01 AM Mate, ASP is a server-side language, you cannot abandon a session with the click of a button. What you can do; have the button submit to a page on the server. That page will abandon the session. <form action="abandonSession.asp" method="get"> <input type="submit" name="btnSubmit" value="Abandon Session" /> </form> Regards, Andrew Buntine. PeOfEo 04-03-2004, 01:02 PM Originally posted by buntine Mate, ASP is a server-side language, you cannot abandon a session with the click of a button. What you can do; have the button submit to a page on the server. That page will abandon the session. <form action="abandonSession.asp" method="get"> <input type="submit" name="btnSubmit" value="Abandon Session" /> </form> Regards, Andrew Buntine. If you put that submit button on the same page though and it resends it you are abandoning the session when the user clicks the button. In asp.net I use event drivne controls, but that is basically what they are doing. I did not know you could not specify events in asp classic though.... buntine 04-03-2004, 01:13 PM No, the session cannot be abandoned from the clients machine. It only exists on the server. PeOfEo 04-03-2004, 02:28 PM Originally posted by buntine No, the session cannot be abandoned from the clients machine. It only exists on the server. I know that. But you are still clicking a button and killing the session... it resends it back to the server. If I click the submit button on this form it is still adding the form contents to the data base, it just resends the data to the server first. I did not say it was using a client side onclick event handler. buntine 04-03-2004, 10:34 PM So what are you disagreeing about?? What i said to him was he must first invoke the code from the server before a session can be deleted. What is it about that which you dont agree with? PeOfEo 04-04-2004, 09:41 PM I was wondering if you could use an event in vb, like sub btn_click(sender as object bla bla bla bla)... and it would send the stuff back to the server on click of the button. I am not sure if you can do it in classic or not.... buntine 04-04-2004, 10:13 PM No no. ASP isnt a fully-fledged programming language. Its just a collection of objects, hence the reason it can be written in any language. The basic idea behind it is similar to that of ActiveX back in the late 90s.. Regards. PeOfEo 04-04-2004, 10:52 PM so it does not have any of the event driven capabilites of its successor then. buntine 04-05-2004, 12:26 AM No, not really. The only real event invokation is done from the global.asa file in the form of Session_OnStart, etc, etc. Infact, ASP and ASP.NET are completely different -- of coarse, syntax-wise, they are similar.. Regards. laue 04-07-2004, 02:30 PM <form action="stop_session.asp"> <input type="submit" value="end session" name="end session"></input> </form> in stop_session.asp: <% Session.Abandon %> Why do y'all think that wouldn't work?? buntine 04-07-2004, 02:33 PM It does work... We have already given him that code. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |