I have a querystring alike value set in a plain string. I started to split string to get value out but I started to wonder that I can proabably write this in one line instea
RichardOD is on it with HttpUtility.ParseQueryString but don't forget to look at TryParse
.
You can TryParse int, DateTimes etc
How do you test your Request.QueryString[] variables?
You can do it this way:
using System.Collections.Specialized;
NameValueCollection query = HttpUtility.ParseQueryString(queryString);
Response.Write(query["id"]);
Hope it helps.
Look at HttpUtility.ParseQueryString. Don't reinvent the wheel.