Losing value when passing as QueryString

S

SusanC

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

Steven Burn

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
|
| 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>
|
|
|
| Don't just participate in USENET...get rewarded for it!
 
Q

qaz

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

SusanC

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

qaz

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

Bob Barrows [MVP]

SusanC said:
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.
 
S

SusanC

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

Bob Barrows [MVP]

SusanC said:
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
 
S

SusanC

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. :)
 
B

Bob Barrows [MVP]

SusanC said:
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
 
S

SusanC

I took this knowledge and changed it to a regular variable that I pass
through via querystrings and wa-la, it works! This will get it done for
now, thanks ever so much!!!
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top