Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Passing Session In QueryString!

Reply
Thread Tools

Passing Session In QueryString!

 
 
Arpan
Guest
Posts: n/a
 
      09-15-2005
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

 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      09-15-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
>



 
Reply With Quote
 
 
 
 
wolfing1@yahoo.com
Guest
Posts: n/a
 
      09-16-2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
passing copy of a pointer to a variable vs passing the copy pereges C Programming 7 06-01-2008 02:36 PM
Session Timeout problems-web.confg session state and IIS session s =?Utf-8?B?Um9iSEs=?= ASP .Net 4 04-11-2007 04:52 PM
Passing by const & and returning a temp vs passing by value and returningit Victor Bazarov C++ 25 03-23-2005 04:24 PM
Session State - What does it take to establish one single ASP.NET session per "browser session" Jeff Smythe ASP .Net 3 01-02-2004 04:10 AM
How can I "know" the difference between a session timed out and a session that did session.abort? Jazzis ASP General 2 09-23-2003 07:16 AM



Advertisments