Easy URL Query parsing?
-
Is there any build in functionality to parse standard query string like this: string1=hello+dear+friend%21&string2=otherdata+here+%25%26 Anything in the framework? If not I'll write it, should I put it here as an article?
If you're trying to parse the query string from an ASP.NET page (like an .aspx file), you can use
Request.QueryString
orRequest.Params
(combination of POST and GET variables). When getting the value from the parameter dictionary, the values are automatically decoded. Otherwise, there is many ways this can be parsed, like usingString.Split
with the &, the doing the same to split the key/value pairs using the = character. TheHttpUtility
class has both aUrlDecode
andUrlEncode
method, both overloaded.Microsoft MVP, Visual C# My Articles
-
If you're trying to parse the query string from an ASP.NET page (like an .aspx file), you can use
Request.QueryString
orRequest.Params
(combination of POST and GET variables). When getting the value from the parameter dictionary, the values are automatically decoded. Otherwise, there is many ways this can be parsed, like usingString.Split
with the &, the doing the same to split the key/value pairs using the = character. TheHttpUtility
class has both aUrlDecode
andUrlEncode
method, both overloaded.Microsoft MVP, Visual C# My Articles