Getting Current WebURL
1)In Webparts.
SPWeb web = new SPSite(SPContext.Current.Web.Url.ToString()).OpenWeb();
2)In Event receivers.(Properties)
string mysite = properties.WebUrl;
SPWeb web = new SPSite(mysite).OpenWeb();
Getting Current User
1)In webparts
string user = SPContext.Current.Web.CurrentUser.ToString();
2)In EventReceivers
string user=properties.ListItem.Web.CurrentUser.ToString();
Subscribe to:
Post Comments (Atom)
Content Editor Webpart not showing up in SharePoint Online ------------------------------------------------------------------------------...

-
Category : Admin Backup : For site collection backup : stsadm.exe -o backup -url -filename [-overwrite] For catastrophic backup: sts...
-
Regarding “SharePoint Foundation” and “SharePoint Server 2010”, the important thing to understand is that SharePoint Foundation is the found...
-
To use RSS Feeds with lists and libraries, first, make sure RSS Feeds are enabled for your site, and then enable the feed for the list or li...
No comments:
Post a Comment