We faced the same problem. Our solution was to pack all the parameters into one URLEncoded and Base64-encoded parameter and split it on the other side. We observe a similar approach in WebResource.axd and ScriptResource.axd.
Quick and dirty way (using simple helper methods for Base64 encoding / decoding):
string parameters = args.Join('|'); imgSomething.ImageUrl = "Generator.aspx?d=" + Server.UrlEncode(Base64Encode(parameters));
in Generator.aspx:
string data = Base64Decode(Server.UrlDecode(Request.QueryString["d"].ToString().Trim())); string[] parameters = data.Split('|');
If you want to use parameter strings in the querystring style (i.e. x = 1 & y = 2 & z = 3), there is a bunch of example code that will let you navigate between the string and the name ValueCollection.
source share