How to remove the port number from a url string

Posted by Brono The Vibrator on Stack Overflow See other posts from Stack Overflow or by Brono The Vibrator
Published on 2010-05-12T13:44:06Z Indexed on 2010/05/12 14:24 UTC
Read the original article Hit count: 235

Filed under:

I have the following code snippet:

string tmp = String.Format("javascript:window.open('{0}');", url);

ClientScript.RegisterClientScriptBlock(this.GetType(), "NewWindow", tmp);

the url generated by this code include the port number and I think that is happening becasue port 80 is used by the website and in this code I am trying to load a page from a virtual directory of the website. Any ideas on how to supress the port number in the url string generated by this code?

© Stack Overflow or respective owner

Related posts about c#