SharePoint: SPContext.Current returns null for in SharePoint foundation 2010
问题 I am using the below code to access the web-application from sharepoint. SPWebApplication webApplication = SPContext.Current.Site.WebApplication; it works fine with the sharepoint server 2010(MOSS2010) . But when I work with SharePoint foundation 2010(WSS4.0) SPContext.Current always returns null. Can anyone tell me what could be the reason for this? and how can i resolve this issue? Thanks and regards, Sharmila 回答1: One of the common reasons I've seen where SPContext is found to be null is