Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

Retrieve QueryString from Vendor Supplied Software?

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?

Thanks.
0
jtrapat1
Asked:
jtrapat1
  • 3
  • 3
1 Solution
 
McExpCommented:
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.
0
 
davisnwCommented:
I'm not that familiar with reporting services.  However, in general asp.net programming, you can retrieve a querystring value by doing something like the following:

Request.QueryString("LocationID")

I believe part of the .NET framework should be available, so perhaps something like that might work.
0
 
jtrapat1Author Commented:
Thanks
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.


Thanks.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
davisnwCommented:
>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 http://whateverurl.com/somepag.html?LocationID=somevalue.  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 />")
        Next

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 />")
        Next

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 />")
            Next
        Next

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 />")
        Next



Finally, a useful firefox extension for seeing what is going on between requests on different pages is Tamper Data:  https://addons.mozilla.org/en-US/firefox/addon/966
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: https://addons.mozilla.org/en-US/firefox/addon/60

Click Forms -> Display Form Details, and it will quickly show you all of the form inputs on a web page.
0
 
davisnwCommented:
Similarly for the ViewState:

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

However, I doubt that the value you seek would be stored in the ViewState.
0
 
jtrapat1Author Commented:
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:
http://whateverurl.com/somepag.html?LocationID=1

Ill try what you suggested and respond tomorrow-Mon.
Thanks again.
John  
0
 
jtrapat1Author Commented:
Thanks for the help - it worked as you suggested.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now