I need to get main site url from inside my custom webpart. Is there any programming way to do it?
Asked
Active
Viewed 1,572 times
1 Answers
3
Try :
SPWeb currentWeb = SPContext.Current.Web;
SPWeb rootWeb = currentWeb.Site.RootWeb;

tinky05
- 250
- 5
- 13