Solved

Session Variables

Posted on 2004-09-15
2
1,195 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hide/ show a recordset row item 6 458
web development software 2 441
removing xml elements and children 5 540
Adding an Audio File (MP3) to a Website (HTML) page 2 198
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 article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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