Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Losing value when passing as QueryString

Reply
Thread Tools

Losing value when passing as QueryString

 
 
SusanC
Guest
Posts: n/a
 
      01-24-2005

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>


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      01-24-2005
Have you done a response.write on the value you are trying to use? (just to make sure it actually contains something)

--

Regards

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

Keeping it FREE!

<SusanC> wrote in message news:(E-Mail Removed)...
|
| 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>
|
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
qaz
Guest
Posts: n/a
 
      01-24-2005
I ran into this once before too. Your security settings on the testing
server are probably different from those on the production server. Check
the production server and make sure that session cookies are enabled.


<SusanC> wrote in message news:(E-Mail Removed)...
>
> 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>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
SusanC
Guest
Posts: n/a
 
      01-24-2005
Thanks, but we have several web apps on this server and have been using
this dir as well for a while now (3+yr) and are using querystrings a
lot. These are the things that keep making my hair get more gray!!
It couldn't be the diff between a number and string because I believe
the url is considered a string....any more ideas ?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
qaz
Guest
Posts: n/a
 
      01-24-2005
The problem is not the querystring. The problem is that your production
server is probably blocking the session variable so nothing is getting
passed on the querystring.


<SusanC> wrote in message news:uCU%(E-Mail Removed)...
> Thanks, but we have several web apps on this server and have been using
> this dir as well for a while now (3+yr) and are using querystrings a
> lot. These are the things that keep making my hair get more gray!!
> It couldn't be the diff between a number and string because I believe
> the url is considered a string....any more ideas ?
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      01-24-2005
SusanC wrote:
> 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.


Please clarify. The whole querystring disappears? Or just the portion that
should contain the value being passed?
And when does it disappear?

> 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>
>


Is it correct when you view the page's source? If not, the you may have
Session turned off in your web site properties.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
SusanC
Guest
Posts: n/a
 
      01-24-2005
The value in the parameter is not there in the url when I load the page
(asp) on the web server and call the report from there. When I click on
the link running the page on my localhost the value is in the url
calling the report. Hope that is more clear.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      01-24-2005
SusanC wrote:
> The value in the parameter is not there in the url when I load the
> page (asp) on the web server and call the report from there. When I
> click on the link running the page on my localhost the value is in
> the url calling the report. Hope that is more clear.
>


That's still not clear. A picture is worth a thousand words. You can clear
up this misunderstanding by viewing the page's source and copying and
pasting the href content from notepad into your message.

Try to do this:

<%
Response.Write "Session(""txtURID"") contains """ & _
Session("txtURID") & """"
%>

Run the page. If you see this:

Session("txtURID") contains "<some value>"

then we can stop speculating about session being disabled. if you see this:

Session("txtURID") contains ""

Then:
a) Your website has sessions turned off - check it using IIS Manager. This
is a website-specific setting.
b) Your browser is refusing session cookies from the web server

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
SusanC
Guest
Posts: n/a
 
      01-24-2005
That may be it. I can set a variable and it passes through fine but
when I try to pass the session variable it's empty. What do we have to
get the web server folks to do, so we will know exactly what to tell
them.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      01-24-2005
SusanC wrote:
> That may be it. I can set a variable and it passes through fine but
> when I try to pass the session variable it's empty. What do we have
> to get the web server folks to do, so we will know exactly what to
> tell them.
>
>

Look at your website in IIS Manager on your local machine. Right-click it
and choose Properties. Click the Configuration button in the Application
Settings section of the Virtual Folder tab. Click into the App Options tab.
See the first checkbox on the tab?


If it's checked, then session state is turned on. If session data is still
being lost, then your browser is refusing session cookies and must be
configured to accept them, usually by adding the site to the Trusted
security zone in Tools | Internet Options (if using IE).

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
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
Regex losing <br> (different from the earlier topic about losing $1) Jason C Perl Misc 4 06-26-2012 10:29 PM
Losing Drives - Finding Drives - Losing Drives mel@no.spam.com Computer Support 2 09-21-2007 10:16 PM
How to get value of QueryString inside QueryString Mehdi ASP .Net 6 04-06-2006 03:41 PM
Passing QueryString URL as a paremeter in QueryString Adeel Ahmad ASP General 1 03-07-2006 02:05 PM
Losing XML nodes when passing from VBA to Web Service Matt Fitzmaurice ASP .Net Web Services 0 10-03-2003 10:50 AM



Advertisments