building a custom url
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.as开发者_高级运维px?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.
I would say use a combination of the System.UriBuilder class and this:
How to build a query string for a URL in C#?
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");
精彩评论