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...


K P Singh ChundawatRank #1,527 · 1K reputationPosted Jan 10, 2015, 6:18 PM EST
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
Khargesh RajputRank #616 · 3.9K reputationPosted Jan 10, 2015, 11:07 PM EST
string currenturl=Request.Url.AbsoluteUri;
or //
string domain= currenturl.Substring(0, currenturl.IndexOf(".") + 1);
string display="Hi...."+domain;