Retrieve QueryString from Vendor Supplied Software?

Posted on 2007-10-19
Last Modified: 2013-11-26
We are using Visual Studio 2005 with SQL Server 2005-
We are using Vendor Supplied Software.
We are adding our own custom reports thru SQL Reporting Services but one of the important variables that we need is not easy to retrieve.
On the main app page, I can see where the developer passes this Location ID inside a querystring so my question is this:
Is there any way that we can retrieve this value to be used for external reporting?
If it cant be retrieved from the querystring, are there any other hidden variables like Session Variable or ViewState that I could trap this value?
Or, are there any utilities that I could use to see the value of all variables, hidden or otherwise, used in the web forms?

Question by:jtrapat1
    LVL 16

    Expert Comment

    If you use firefox there are plenty of add-ins which will help you to see all variables, hidden or otherwise, used in the web forms.

    Search for development extensions on the Mozilla site for more information.
    LVL 3

    Expert Comment

    I'm not that familiar with reporting services.  However, in general programming, you can retrieve a querystring value by doing something like the following:


    I believe part of the .NET framework should be available, so perhaps something like that might work.

    Author Comment

    I kow you can get the QueryString like that -
    but how do I know the variable is called LocationID;
    Since that is server_side and i can only see the client-side in the View Source,
    Is there a way to see the names of all underlying variables?

    Ill try that when I get back to work on Mon.

    LVL 3

    Accepted Solution

    >I kow you can get the QueryString like that -
    >but how do I know the variable is called LocationID;
    >Since that is server_side and i can only see the client-side in the View Source

    Perhaps we are talking past each other a bit here.  When you say query string, that has a specific meaning in the browser context: e.g., I was assuming that you meant you were seeing  In this context, the query string is completely visible client side.

    Looking at your post again, I think that perhaps you meant a SQL query?  In this case my previous answer would not be applicable.   Please clarify exactly where you are seeing the Location ID.

    As far as seeing the underlying variables, you can do a few things programmatically:

    To see all the session variables, do something like (the following is VB.NET code, but will work if appropriately translated for any .NET language)

            For Each key As String In Session.Keys
                Dim value As String = Session(key)
                Response.Write(key & "=" & value & "<br />")

    For the Form Variables (generally POST):

            For Each key As String In Request.Form
                Dim value As String = Request.Form(key)
                Response.Write(key & "=" & value & "<br />")

    For Cookies:

            For Each key As String In Request.Cookies.Keys
                Response.Write("---" & Request.Cookies(key).Name & "---<br />")
                For Each cookieKey As String In Request.Cookies(key).Values.Keys
                    Dim value As String = Request.Cookies(key).Values(cookieKey)
                    Response.Write(key & "=" & value & "<br />")

    You can also loop through the url querystring variables like so:

            For Each key As String In Request.QueryString
                Dim value As String = Request.QueryString(key)
                Response.Write(key & "=" & value & "<br />")

    Finally, a useful firefox extension for seeing what is going on between requests on different pages is Tamper Data:
    It will even let you view and modify the post requests before the actual post is completed.

    To easily view all of the form elements on a web page, I recommend the firefox extension  Web Developer:

    Click Forms -> Display Form Details, and it will quickly show you all of the form inputs on a web page.
    LVL 3

    Expert Comment

    Similarly for the ViewState:

            For Each key As String In ViewState.Keys
                Dim value As String = ViewState(key)
                Response.Write(key & "=" & value & "<br />")

    However, I doubt that the value you seek would be stored in the ViewState.

    Author Comment

    Thanks for all the help-
    The value that I want to capture is the querystring;
    I see the value in the status bar when I put the mouse over one of the links on a navigation side menu-
    For example:

    Ill try what you suggested and respond tomorrow-Mon.
    Thanks again.

    Author Comment

    Thanks for the help - it worked as you suggested.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now