0

i am building a asp.net web page where i will provide two text boxes where user can enter the id and link and once the user click the button i will generate the below ur

i have a ur like this

http://www.hostname.com/controller.aspx?id=123&link=abc123

the id and link value will provide by the user and i am looking for a way to build the url in a more optimized way.

Nick Kahn
  • 19,652
  • 91
  • 275
  • 406

2 Answers2

0

I would say use a combination of the System.UriBuilder class and this:

How to build a query string for a URL in C#?

Community
  • 1
  • 1
Jeremy Holovacs
  • 22,480
  • 33
  • 117
  • 254
-1

here is how i able to build

const string URL = "http://www.hostname.com/controller.aspx?id={0}&link={1}";
string.Format(URL, "123","aaa123");
Nick Kahn
  • 19,652
  • 91
  • 275
  • 406