spcontext

SharePoint SPContext.List in a custom application page

I have a custom SharePoint application page deployed to the _layouts folder. It's a custom "new form" for a custom content type. During my interactions with this page, I will need to add an item to my list. When the page first loads, I can use SPContext.Current.List to see the current list I'm working with. But after I fill in my for...

SPContext in Event Receiver (PortalSiteMapProvider)

I'm trying to write an event receiver which uses the PortalSiteMapProvider. Without having HTTPContext or SPContext INSIDE the event receiver, how would one go about accessing the PortalSiteMapProvider? ...

Custom web service context issue

hi All, I have created a custom web service and deployed it to _layouts folder. it seems like SPContext.Current.Web.Url always return the root web url no matter when the web service is calling from. does sharepoint rewrite the reuqest url for web service somehow? thx Kevin ...

No current context when creating a sharepoint site

I've added a feature to my onet.xml file which gets activated whenever a site gets created. However, that feature needs to know the url of the site being created. I thought I could figure that out from the current SPContext within the activation event of the feature, but when I created the site I got a null reference on SPContext.Current...

SPWeb.Url returns wrong URL

I have a web application in SharePoint that has been extended to another zone (Extranet). The access URL for the default zone is http ://server1, and the URL for the extranet zone is https: //www.server1.com. Now, when I access the site via the extranet zone, I find that SPContext.Current.Web.Url returns http ://server1. I would have ex...

SharePoint 2007 HttpHandler NullReferenceException using SPContext.Current.Site/Web when called from jQuery

I have the need to develop a custom HttpHandler in SharePoint. To start, I just coded up a simple example: http://pastebin.com/HXLjR2xT. On line 35 or 36 of that code I get a NullReferenceException thrown if I call my HttpHander page from jQuery. But if I call the page directly in my browser, I get the results I expect. I have seen some ...

Access a MySite Blog from a home page webpart

I've been away from SharePoint development for quite a while now, and I'm trying to access the information in a SharePoint 2010 blog (from one of our users, within their "MySite") from a C# webpart which will reside on the homepage of the site. The idea is to be able to highlight a certain user's latest post on the home page. Can any...