How to achieve part of webpage address on ?Webpage? screen when we hit it.
example.
www.example.com - should display 'Hi....WWW'
abc.example.com - should display 'Hi.... ABC'
def.example.com - should display 'Hi... DEF'
please suggest the way how we can do it...

Khargesh RajputPosted Jan 11, 2015, 4:07 AM
string currenturl=Request.Url.AbsoluteUri;
or //
string domain= currenturl.Substring(0, currenturl.IndexOf(".") + 1);
string display="Hi...."+domain;
K P Singh ChundawatPosted Jan 10, 2015, 11:18 PM
You should use window.location to get Current url from browser and then substring url using following methods
String.slice( begin [, end ] ) String.substring( from [, to ] ) String.substr( start [, length ] )
string.lastIndexOf(searchValue[, fromIndex])
then u can display this substring string according to your requrment.
----------------------------------------------------------------------------------------------------------------
If this post is helpful for you then please mark it as "Accepted Answer"
Thanks
KP Singh