I am migrating my WebParts from Farm Solution to Sandboxed solutions in SharePoint 2010.
Before I was doing this:
using (SPSite site = new SPSite(SPContext.Current.Web.Url) )
{
...
..
}
My sandbox solutions fails when accessing SPContext.Current.
How can I obtain the current SPSite or the current URL?
Thanks in advance!
Try use HttpContext.Current.Request.Url or HttpRequest.Url Property