What's the most efficient way to get a specific parameter from a relative URL string using C#?
For example, how would you get the value of the ACTION
parameter from the following relative URL string:
string url = "/page/example?ACTION=data&FOO=test";
I have already tried using:
var myUri = new Uri(url, UriKind.Relative);
String action = HttpUtility.ParseQueryString(myUri.Query).Get("ACTION");
However, I get the following error:
This operation is not supported for a relative URI.