Solved

Session Variables

Posted on 2004-09-15
2
1,193 Views
Last Modified: 2012-06-22
I am building a  Dynamic Web Site in Dreamweaver.  I am trying to create a session variable that stays active as long as the person is on the site.  My session variable is called MM_SiteID.  Here is the code I have in my main page (this is the page that the user gets after they log in).


Session("MM_SiteID")="";
<%Session("MM_SiteID")= Request.QueryString("tSiteID").Item%>

I put this in the Form Tag.  When I go to my next page the session variable does not carry over, it says undefined.  But if I replace the Request.QueryString with just some hardcoded text such as "Hello", this will carry over to the next page.  I am trying to pull a field from my form.  I have a recordset called rsLogin.  Once a user logs on, the record set is defined just to have their information in it (which it does) and what I am trying to do is pull the site ID out of this rs and put it in a session variable.  Where am I going wrong?
0
Comment
Question by:suezyg23
2 Comments
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 12065170
> Request.QueryString("tSiteID").Item

You need to Take Out .Item if its a Form Field, Like this..
Request.QueryString("tSiteID")

And Also Make Sure the Form method is "GET" not Post.
0
 
LVL 14

Accepted Solution

by:
Esopo earned 125 total points
ID: 12066883
As adilkhan said:
Request.QueryString("tSiteID") - if it is a GET form

And,

Request.Form("tSiteID")  - if it is a POST form

This page will help you grasp the concept:
- ASP Forms and User Input
http://www.w3schools.com/asp/asp_inputforms.asp


You may also want to read these:
- http://www.bellaonline.com/articles/art18862.asp
- http://coveryourasp.com/Session.asp

- Pros & cons of session variables:
http://www.4guysfromrolla.com/webtech/092098-2.shtml
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
website template 12 333
Issue when emailing and there is a space 7 394
COLDFUSION 9 DEVELOPMENT SERVER STOPPED WORKING 9 448
Rotating Adobe pdf document 4 310
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question