[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

QueryString has a value but not in code behind

when calling a page with a querystring, there is clearly a value there (i.e. www.mydomain.com/mypage.aspx?pair=value

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...
0
conrad2010
Asked:
conrad2010
  • 2
  • 2
1 Solution
 
HainKurtSr. System AnalystCommented:
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...
0
 
conrad2010Author Commented:
bp turns up empty, either way I try this... been working with asp.net ever since it came out... never seen anything like this either...
0
 
HainKurtSr. System AnalystCommented:
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...
0
 
conrad2010Author Commented:
try creating a brand new page --> that worked...
0

Featured Post

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!

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