Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Session Variable Help
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

coachdan
Starting Member

USA
1 Posts

Posted - 26 September 2003 :  18:00:18  Show Profile
I am new to ASP and have never used session variables before. I am trying to pass the value of a dropdown box on a form to a session variable to be called by other pages in my site. I will post the code for a test I am using to get the code figured out:

Form (sending page):

<%@ Language=VBScript %>
<html>
<%

Session("varRedirectBus")=Request.Form("RedirectBus")
%>

<head>
<title></title>
</head>

<body background="\Training_Dept\WB00760_.gif">

<hr>

<hr>

<p><font size="6">Main Menu - Select Proper Database Menu</font></p>

<hr>

<hr>

<form ACTION="\Training_Dept\sessionTest.asp" METHOD="POST">
  <b><u><i><font Size="4"><p>Select Yearly Menu:</font></i></u></b> <select
  NAME="RedirectTo" tabindex="1" size="1">
    <option Selected value=" ">--SELECT YEAR--</option>
    <option value="MenuDefault02.asp">2002</option>
    <option value="MenuDefault03.asp">2003</option>
    <option value="MenuDefault04.asp">2004</option>
  </select> <br>
  <br>
  <b><u><i><font Size="4"></p>
  <p>Select Business:</font></i></u></b> <select NAME="RedirectBus" tabindex="1" size="1">
    <option Selected value=" ">--SELECT BUSINESS--</option>
    <option>Citi</option>
    <option>Sears</option>
  </select></p>
  <p> <br>
  Go To Correct Year: <input type="submit" name="submit1" value="submit" tabIndex="2"> </p>
  <p>Reset Form:            <input
  id="reset1" type="reset" value="Reset" name="reset1" tabIndex="3"></p>
  <p> </p>
  <!--webbot bot="HTMLMarkup" startspan TAG="XBOT" --></SCRIPT><!--webbot bot="HTMLMarkup" endspan
  -->

</form>
</body>
</html>


Recieving page:

<html>
<%@language="vbscript"%>
<%
response.write RedirectBus
Session("varRedirectBus")=Request.Form("RedirectBus")

%>

<head>
<title>Session Test</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>

<body>

<p>The Business chosen was <%=varRedirectBus%>!</p>
</body>
</html>


Can someone please help me, I am under some close deadlines and have been trying to figure this out for some time. All I get on the recieving page is the text.

coachdan

http://www.highviewheat.com/index.asp

http://kristensfastpitchworld.com

altisdesign
Junior Member

United Kingdom
357 Posts

Posted - 26 September 2003 :  18:21:30  Show Profile
Try

<p>The Business chosen was <%=varRedirectBus%>!</p>

Replace with

<p>The Business chosen was <%=session("varRedirectBus")%>!</p>

To write out a session variable the code is

<%
Response.write session("variablename")
%>

Altis Design offers all manner of web design services to a variety of commercial and personal clients

Edited by - altisdesign on 26 September 2003 18:22:20
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07