473,503 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing Session In QueryString!

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

Sep 15 '05 #1
2 2317
Have you done a response.write on Session("RecCol") to see what it actually
contains?

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Arpan" <ar******@hotmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
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

Sep 15 '05 #2
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

Arpan wrote:
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


Sep 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2583
by: SusanC | last post by:
Hi folks. I have something here that I don't understand. I am passing a value held in a session variable on a url. It works fine locally testing but when I put it on the main web server the...
1
2910
by: Newbie | last post by:
Is there a way to pass strings from one webform to another without using Response.Redirect( ) ? The reason is that I need the webform passing the string to close its window.
7
43233
by: Anne | last post by:
hie there, i want to be able to pass multiple parameters to another page. currently, i am able to do so, but somehow i feel it is not the correct way to do it. below is part of what i have so far....
1
1671
by: Russell | last post by:
Hi there, I'm currently creating a .NET Web Application and I have a question about passing values from one screen to another. I previously used Session variables in the code to store these...
3
1558
by: Lee | last post by:
Hi All How can I pass options from one webpage into another webpage. When the user clicks on the hyperlink I want them to be go to the next page but I need to pass in a number that the next...
4
7150
by: David Freeman | last post by:
Hi There! I'm just wondering if there's a way to pass parameters (as if you were passing parameters to a ASCX web control) when calling an ASPX page? e.g. MyDetailsPage.UserName = "david" ...
5
1835
by: Jim via DotNetMonster.com | last post by:
Hi, I need to pass the value of a variable from one function to another but I don't seem to get the value. I declare the variable outside all functions. What I'm trying to do is that when the...
3
2508
by: catweezle2010 | last post by:
Hello NG, I have three files (default.aspx, search.aspx and work.aspx). The way is: login on default (if session is newsession). The loginname I write into as sessionvariable (username). So I...
5
1819
by: glenn | last post by:
Hi folks, The problem I have is that a query string works if hard-coded but if I pass a variable to it, it does not work as shown here. This works: querystring="SELECT * FROM USERS WHERE...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.