c# - Best way to add a key/value to an existing URL string? -


I want to generate a link on my page where a key / value pairing URL is added dynamically so that:

default.aspx? Key1 = value1

is created:

default Aspx? Key1 = value1and Key2 = value2

to retain any keys to the current curie in the URL. Also, if there are no keys, then my key is' ? because it will be required.

I can easily write some argument which does this, but it seems that there should be a suitability for the structure. Is there any way to add keys to a string without writing my own argument?

I know, it is weird that it is not supported properly in the .NET Framework. Whatever you need, do anything.


Comments