Acces to User Credential from UC withing SP

Mar 18, 2008 at 8:55 PM
can someone help me with: How to get the user credentials (username) from code in my user control code behind that is running in the smart part?
thanks
Mar 20, 2008 at 6:16 AM
I think your problem will be solved with referencing Microsoft.SharePoint assembly to get access to SPContext.Current. Adding reference directly in ASCX-control can done like this:
<%@ Assembly Name="Microsoft.SharePoint" %>
You can also reference other assemblies in the same way to extend your control's possibilities.