Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 13th, 2005, 03:47 PM
TRafati TRafati is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 22 TRafati User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 7 m 22 sec
Reputation Power: 0
Can't get these session variables to close...

I have a window that pops up to allow the user to change password. In order to give the error messages I created a few session variables. I'm trying to figure out the best way to get them closed. I was thinking of having it on browser window close or I would have the Close Button call a function to end the sessions and then close the window, but I can't seem to figure out where to put the function or how the button calls for the function.

I was thinking of just having the Session.Content.Remove in the IF statements down in the gut of the code.

this is what I have so far.

Code:
<%@LANGUAGE="VBSCRIPT"%>
<% 
option explicit
response.expires=0

if Session( "username" ) = "" Then Response.Redirect "members.asp" 
%>

<% Function CloseSessions()
Session.Content.Remove ( "Fail" )
Session.Content.Remove ( "Success" )
Session.Content.Remove ( "NotEqual" )
Session.Content.Remove ( "Empty" )
window.close()
%>


<html>
<head>
	<title>Street Team Profile Password Change</title>
    <style type="text/css">
	.small {font-family: Verdana,Geneva,Arial,Helvetica,sans-serif; font-size: 7pt}
	.text {font-family: Verdana,Geneva,Arial,Helvetica,sans-serif; font-size: 8pt}
	</style>
	<meta http-equiv="Page-Enter" Content=blendTrans(Duration=.5)">
<SCRIPT LANGUAGE="JavaScript">
<!--
		function MM_goToURL() { //v3.0
		var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
		for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->

</script>


<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>

<body bgcolor="7094ac" text="#000000" link="#FFFFFF" alink="#FFFFFF" vlink="#999999">

<FORM ACTION="passupdt.asp" method="post">

<div align="center">
	<table width="284" height="170" border="0" cellpadding="0" cellspacing="0" class="text">
		<tr>
		  <td width="284" height="170" valign="top" bgcolor="c5cdc5">
				<table width="287" height="135" border="0" cellpadding="0" cellspacing="0" class="text">
                	<tr>
                	  <td width="7">&nbsp;</td>
						<td width="116" height="26"> Username:</td>
						<td width="164" height="26"><% Response.Write session("username") %></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
						<td height="26">Old password:</td>
						<td height="26" valign="middle"><input name="oldpass" type="password" class="small" id="oldpass" size="20" maxlength="20"></td>
                    </tr>
					<tr>
					  <td>&nbsp;</td>
						<td height="26">New Password:</td>
						<td height="26"><input name="npass1" type="text" class="small" id="npass1" size="20" maxlength="20"></td>
					</tr>
					<tr>
					  <td>&nbsp;</td>
					  <td height="26">Retype New Password:</td>
					  <td height="26"><input name="npass2" type="text" class="small" id="npass2" size="20" maxlength="20"></td>
				  </tr>
					<tr>
					  <td height="26" colspan="3">
					  	<div align="center">
					  		<% If Session( "Empty" ) = True Then %>
								<font COLOR="red">You must enter all the required fields</font>
							<% End If %>  
							<% If Session( "NotEqual" ) = True Then %>
								<font COLOR="red">Both Password fields must have the same value</p></font>
							<% End If %> 
							<% If Session( "Fail" ) = True Then %>
								<font COLOR="red">Invalid Password</font>
							<% End If %> 
							<% If Session( "Success" ) = True Then %>
								<font COLOR="red">You have successfully changed your password</font>
							<% End If %>
						</div>
					  </td>
			    	</tr>
			  </table>				
			  <div align="center">
			  	<input name="bSubmit" type="submit" id="bSubmit" value="Change">
			  	<input name="bClose" type="button" id="bClose" onClick="CloseSessions();" value="Close">
		      </div>
		  </tr>
	</table>
</div>

</FORM>

</body>
</html>

Reply With Quote
  #2  
Old September 13th, 2005, 10:16 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
session.abandon will destroy the current session object. You should ask this in the asp forum btw.

Also, window.close is a browser function and shouldn't be in a server side asp function
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old September 14th, 2005, 01:47 PM
TRafati TRafati is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 22 TRafati User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 7 m 22 sec
Reputation Power: 0
ok, thanks for the response. I'll move this to the ASP section.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Can't get these session variables to close...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT