473,657 Members | 2,572 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("re cords")
strCol=Request. QueryString("co lumns")

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="gotoU RL(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="JavaS cript">
function gotoURL(objURL) {
window.location .href=objURL.op tions[objURL.selected Index].value
}
</script>

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

Try.asp?records =rec2&column=co l2&sess==''

instead of

Try.asp?records =rec2&column=co l2&sess=col1='r ec1'

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=co l2&sess=#}}

Any suggestions?

Thanks,

Arpan

Sep 15 '05 #1
2 2327
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******@hotma il.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
In my ASP application, a Session variable takes the following form

<%
Dim strRec,strCol
strRec=Request. QueryString("re cords")
strCol=Request. QueryString("co lumns")

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="gotoU RL(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="JavaS cript">
function gotoURL(objURL) {
window.location .href=objURL.op tions[objURL.selected Index].value
}
</script>

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

Try.asp?records =rec2&column=co l2&sess==''

instead of

Try.asp?records =rec2&column=co l2&sess=col1='r ec1'

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=co l2&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("re cords")
strCol=Request. QueryString("co lumns")

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="gotoU RL(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="JavaS cript">
function gotoURL(objURL) {
window.location .href=objURL.op tions[objURL.selected Index].value
}
</script>

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

Try.asp?records =rec2&column=co l2&sess==''

instead of

Try.asp?records =rec2&column=co l2&sess=col1='r ec1'

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=co l2&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
2600
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 value disappears. Nothing fancy here, real simple...what I am missing ? <a href="http://ServerName/ReportServer?/SomeRpts/rpt1&urid=<%= Session("txtURID") %>" target="blank">Contracts - Client Listing</a>
1
2917
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
43259
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. 'first page Private Sub btnOK_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click Response.Redirect("InputValues.aspx?Requestor=" &
1
1673
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 values, however I can no longer use this method because of my current website "Cloaking" the URL. (When site is cloked, the session variables don't seem to work with frames) Anyway, I was wondering if anyone could offer an alternative, I have tried...
3
1566
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 page needs to reference. Thanks Lee
4
7153
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" OR... the only way to do it is to use the QueryString or Session object?
5
1841
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 button is clicked, check to see if the record exists using input from a form. I want to pass that variable to the button click Sub because if it doesn't exist then the record is inserted and the user is directed to a different page. The variable I'm...
3
2521
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 redirect to my search.aspx. Here I have a form which allows fill in some fields (place, street, name etc.). With this informations i build a sqlquerey for sqlserver, fill a datagrid and after select the right record by usin a link behind I save the...
5
1831
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 CNAME = 'MICROSOFT'" This does not work: Dim var as string
0
8425
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8743
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5647
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
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 we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.