how to find whether the url is http://website.com or http://www.website.com

i would like to find out whether the current url is      with

http://

or

http://www

how can i do it.

regards

ltpindia 

 

0
ltpindia
6/11/2007 8:11:19 AM
asp.net.faq 380 articles. 0 followers. Follow

1 Replies
1212 Views

Similar Articles

[PageSpeed] 14
Get it on Google Play
Get it on Apple App Store

Hi Itpindia,

When you assgin the following to a string:

Page.Request.Url.AbsoluteUri
 

then you have the full path of the url in the browser's address bar. (for example: http://www.microsoft.com/blabla/page02.aspx)

then you take a left trim of that string. for instance the 10 most-left characters. Compare those with "http://www" and if they equal, they equal Smile

hope this helps!
wim


Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
deblendewim
6/11/2007 2:47:24 PM
Reply: