Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read the query string params of a ASP.NET raw URL?

Tags:

I have a variable

string rawURL = HttpContext.Current.Request.RawUrl; 

How do I read the query string parameters for this url?

like image 269
GilliVilla Avatar asked Jul 26 '12 19:07

GilliVilla


1 Answers

This is probably what you're after

  Uri theRealURL = new Uri(HttpContext.Current.Request.Url.Scheme + "://" +   HttpContext.Current.Request.Url.Authority + HttpContext.Current.Request.RawUrl);     string yourValue= HttpUtility.ParseQueryString(theRealURL.Query).Get("yourParm");  
like image 173
Shankar R10N Avatar answered Sep 22 '22 18:09

Shankar R10N