Quantcast
Channel: SharePoint Legacy Versions - Using SharePoint Designer, InfoPath and Other Customizations Forum
Viewing all articles
Browse latest Browse all 2319

SPContext.Current returns null

$
0
0
Hi guys

I have a workflow where I want to get the current user name

private string getCurrentSPUser() 
        { 
            return SPContext.Current.Web.CurrentUser.Name; 

        } 

but, the problem is that "SPContext.Current" returns NULL. Now, I was checking in the web and it says in many sites that it is because it is not running in the same context that the website. How come? My workflow is deployed in my SP website.

I hope you can help me.

Viewing all articles
Browse latest Browse all 2319

Trending Articles