Passing Session In QueryString!

A

Arpan

In my ASP application, a Session variable takes the following form

<%
Dim strRec,strCol
strRec=Request.QueryString("records")
strCol=Request.QueryString("columns")

Session("RecCol")=strCol & "='" & strRec & "'"
%>

The page has a drop-down list. When a user selects an option from the
drop-down, the page gets submitted to itself automatically. This is how
I have done it:

<select name="rc" onChange="gotoURL(this.form.rc)">
<option value="Try.asp?records=<%= strRec %>&columns=<%= strCol
%>&sess=<%= Session("RecCol") %>Option1</option>
......
......
</select>

& this is the JavaScript code that gets executed when an option is
selected from the drop-down:

<script language="JavaScript">
function gotoURL(objURL){
window.location.href=objURL.options[objURL.selectedIndex].value
}
</script>

Now when an option is selected from the drop-down, the URL becomes

Try.asp?records=rec2&column=col2&sess==''

instead of

Try.asp?records=rec2&column=col2&sess=col1='rec1'

I thought that maybe the equal to sign '=' & the single quotes may be
causing the problem & hence replaced these 2 characters while creating
the Session variable in this way:

Session("RecCol")=strCol & "#}" & strRec & "}"

& later replaced "#" with "=" & "}" with single quotes "'" but that
still didn't solve the problem. The URL now becomes

Try.asp?records=rec2&column=col2&sess=#}}

Any suggestions?

Thanks,

Arpan
 
W

wolfing1

Two things that I can think of:
- Cookies are disabled in the browser. Session variables are stored
as cookies, if cookies are disabled, they won't hold information
- global.asa is empty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top