Losing value when passing as QueryString

Discussion in 'ASP General' started by SusanC, Jan 24, 2005.

  1. SusanC

    SusanC Guest

    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!
     
    SusanC, Jan 24, 2005
    #1
    1. Advertising

  2. SusanC

    Steven Burn Guest

    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:...
    |
    | 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!
     
    Steven Burn, Jan 24, 2005
    #2
    1. Advertising

  3. SusanC

    qaz Guest

    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:...
    >
    > 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!
     
    qaz, Jan 24, 2005
    #3
  4. SusanC

    SusanC Guest

    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!
     
    SusanC, Jan 24, 2005
    #4
  5. SusanC

    qaz Guest

    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%...
    > 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!
     
    qaz, Jan 24, 2005
    #5
  6. 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"
     
    Bob Barrows [MVP], Jan 24, 2005
    #6
  7. SusanC

    SusanC Guest

    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!
     
    SusanC, Jan 24, 2005
    #7
  8. 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"
     
    Bob Barrows [MVP], Jan 24, 2005
    #8
  9. SusanC

    SusanC Guest

    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!
     
    SusanC, Jan 24, 2005
    #9
  10. 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.
     
    Bob Barrows [MVP], Jan 24, 2005
    #10
  11. SusanC

    SusanC Guest

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


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    SusanC, Jan 24, 2005
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mehdi
    Replies:
    6
    Views:
    36,254
    sloan
    Apr 6, 2006
  2. Matt Fitzmaurice

    Losing XML nodes when passing from VBA to Web Service

    Matt Fitzmaurice, Oct 3, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    166
    Matt Fitzmaurice
    Oct 3, 2003
  3. Adeel Ahmad
    Replies:
    1
    Views:
    583
    Anthony Jones
    Mar 7, 2006
  4. Carlos Aguayo
    Replies:
    1
    Views:
    91
    Carlos Aguayo
    Oct 4, 2006
  5. Jason C
    Replies:
    4
    Views:
    706
    Morty Abzug
    Jun 26, 2012
Loading...

Share This Page