Home - grothauser/sharepointsnippets GitHub Wiki
Welcome to the sharepointsnippets wiki!
How to use current site in Custom Action:
using (SPSite site = new SPSite(SPContext.Current.Site.WebApplication.GetResponseUri(SPContext.Current.Site.Zone).OriginalString))
{
using (SPWeb web = site.OpenWeb(SPConstants.SecondarySN))
{...}}