3

I need to dynamically construct a url by appending new parameter to the current url.

I know how to do this in the long way by getting the current url and check if there is any QueryString, if no add "?" if yes add "&". Also check is the parameter is already exist. If yes change the value.

But is there any build in .NET function to do this? Like Request.QueryString.Add

Thanks.

Dreteh
  • 387
  • 2
  • 4
  • 11
  • sounds like a duplicate of http://stackoverflow.com/questions/829080/how-to-build-a-query-string-for-a-url-in-c – SteveCav Oct 12 '10 at 03:30

1 Answers1

1

No, there is no built-in method in .Net, you'll have to check manually if url contains ? then add new querystring. or if the parameter already exists then update the value.