Get querystring from URLReferrer

FarFigNewton picture FarFigNewton · Mar 25, 2011 · Viewed 25.6k times · Source

I am trying to get the QueryString value like this Request.QueryString("SYSTEM") from a UrlReferrer. I see i can use this Request.UrlReferrer.Query() but it doesn't allow me to specify the exact parameter

I could parse the Query() value, but I want to know if it is possible to do something like this Request.UrlReferrer.QueryString("SYSTEM")

Answer

Chris Mullins picture Chris Mullins · Mar 25, 2011

You could do

HttpUtility.ParseQueryString(Request.UrlReferrer.Query)["SYSTEM"]

That is c# in vb is is probably something like

HttpUtility.ParseQueryString(Request.UrlReferrer.Query())("SYSTEM")