QueryString has a value but not in code behind

Posted on 2011-10-07
Last Modified: 2012-06-22
when calling a page with a querystring, there is clearly a value there (i.e.

in code behind (C#) the querystring shows up empty...

protected void Page_Load(object sender, EventArgs e)
        var qs = Request.QueryString["pair"].ToString()

and the variable "qs" turns up empty...

any idea how that could happen? There are no redirects, it's all plain and simple...
Question by:conrad2010
    LVL 51

    Expert Comment

    try this

    var qs = Request.QueryString["pair"]

    put a bp, and see what you get

    or try this

    var qs = Request["pair"]

    i dont see any reason to loose the query string param...

    Author Comment

    bp turns up empty, either way I try this... been working with ever since it came out... never seen anything like this either...
    LVL 51

    Accepted Solution

    try creating a brand new page say test.aspx, call it with test.aspx?pair=134 and use

    var qs = Request.QueryString["pair"]

    see if this page works... maybe there is something on <page ....> which prevents clearing all request... or maybe you have a transfer redirect...

    use fiddler to tarck...

    Author Closing Comment

    try creating a brand new page --> that worked...

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    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…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    734 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

    19 Experts available now in Live!

    Get 1:1 Help Now