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...
-
SharePoint went through a major overhaul in capabiltiy, ease of use, ease of administration, and ease of integration. This comparison of Sha...
-
http://weblogs.asp.net/jan/archive/2010/05/07/sharepoint-2010-bdc-model-deployment-issue-the-default-web-application-could-not-be-determined...
No comments:
Post a Comment