Hi,
I need to get main site url from inside my custom webpart. Is there any programming way to do it?
Hi,
I need to get main site url from inside my custom webpart. Is there any programming way to do it?
Try :
SPWeb currentWeb = SPContext.Current.Web;
SPWeb rootWeb = currentWeb.Site.RootWeb;