SharePoint Expiration Date Issue
Submitted by sami on Fri, 06/26/2009 - 11:55The public update to fix this issue is available for download.
Post URL is here: http://blogs.msdn.com/sharepoint/archive/2009/06/25/service-pack-2-updat...
Service Pack 2 Update.
The public update for the Service Pack 2 expiration date issue is now available for download.
The update can be applied before or after Service Pack 2 installation. If the update is applied prior to installing Service Pack 2 it will prevent the expiration date from being improperly activated during installation of Service Pack 2, if it is applied after Service Pack 2 it will remove the expiration date incorrectly set during installation of Service Pack 2.
The update is applicable to all of the products that this issue affected (see the list in the KB linked below).
Installation instructions and download links for x86 and x64 are available in this KB: http://support.microsoft.com/kb/971620
SharePoint feature troubleshooting
Submitted by sami on Fri, 06/19/2009 - 18:04I was getting an object reference error when activating my feature. A couple of things I need to remember:
1. Run code with elevated privileges
2. Installing and activating the feature via stsadm will not like SPContext. I didn't actually use that this time, but read it in my research of the problem and I'm sure I'll do it at some point. The proper method is to reference the properties.partent.site. This can be an SPSite or an SPWeb depending on how you have coded the feature. Check if it is null.
3. Check the folder permissions on you feature folder in the 12 hive.
Time to start the weekend!
SharePoint Permissions Not Working
Submitted by sami on Mon, 05/18/2009 - 18:17I had a site that had originally had Anonymous Access enabled. We turned it off at the site collection and IIS levels, but anyone could access the site still. It looked like SharePoint was just ignoring the AD permissions set on the site and subsites.
Thanks to the article here: http://www.sharepointblogs.com/johnwpowell/archive/2007/07/10/how-to-ena... the solution was to manually turn off Anonymous access for each site by going to _layouts/setanon.aspx. The option for "Entire site" was still set, even though it was greyed out. I set everything to Nothing and things are working now.
How to strip HTML tags for XSLT
Submitted by sami on Thu, 05/14/2009 - 13:33I have to look this up at least once every couple of years. Thought it would be good to put the link and code in a place I can always get to: http://p2p.wrox.com/xslt/54014-strip-html-tags-xslt.html
Use it this way:
Alternative to SharePoint Data Views using JQuery
Submitted by sami on Thu, 05/14/2009 - 13:31One of the nuisances of SharePoint is SharePoint Designer.
"Path to SharePoint" provides a good alternative to this here: http://pathtosharepoint.wordpress.com/2009/01/22/a-simple-method-to-disp...
Two options are an iFrame or, what I opted for, JQuery:
#
# Christophe@PathToSharePoint.com -->
#
#
#
# // Paste the URL of the source list below:
# var SelectedView = "http://domain.com/SiteCollection1/SourceSite/SourceList/MyView.aspx";
# $("#ListPlaceholder").load(SelectedView+" #WebPartWPQ1 .ms-listviewtable",function() {
# $("#ListPlaceholder *").removeAttr("id");
# $("#ListPlaceholder *").removeAttr("onclick");
# $("#ListPlaceholder *").removeAttr("onfocus");
# $("#ListPlaceholder *").removeAttr("onmouseover");
# });
#
Uploading a file to a SharePoint library from C# code
Submitted by sami on Wed, 04/08/2009 - 16:09I needed a way for a user to be able to upload a file to a SharePoint library from a custom web part.
While, the post here: http://elczara.spaces.live.com/blog/cns!554EC06D366AC9D5!692.entry?wa=wsignin1.0&sa=891066527 helped get me started, it only worked when I was on my localhost (and only in IE for whatever odd reason)
Turns out, I needed to modify things a bit so that the file was first uploaded to the server, then copied to the SPList and then I could delete the file from the temp directory.
The code below hasn't been rigorously tested and I need to add some restraints on what types of files can be uploaded. It creates a subfolder, if needed, in the SharePoint library as well.:
public void UploadFile(NewFile file)
{
try
{
string sFileName = flUpload.PostedFile.FileName;
SPSecurity.RunWithElevatedPrivileges(delegate()
{
Editing NewForm.aspx in SharePoint
Submitted by sami on Wed, 03/18/2009 - 11:20You could open up SP Designer to do this, but the easier way is to append ToolPaneView=2 as a querystring to your URL.
SharePoint "Access Denied" Message
Submitted by sami on Wed, 03/18/2009 - 11:19A contributor was receiving an Access Denied message on their own site. I removed all of the web parts (since outside content could be causing a permissions conflict) and checked permissions on all image libraries. Everything looked OK, but still, "Access Denied".
Turns out the Master Page didn't have an approved version published. By going into the gallery and approving the draft, everything worked.
Apple products are getting so small I'll end up losing them.
Submitted by sami on Wed, 03/11/2009 - 17:15http://www.apple.com/ipodshuffle/gallery/
The new iPod shuffle is just the right size to get lost in even the smallest apartment.
SharePoint WSP Error: This solution contains one or more assemblies targeted for the global assembly cache.
Submitted by sami on Fri, 02/06/2009 - 10:51The first step to strong name an assembly is to sign it with a new key in the property pages under the "Signing" tab.
However, I had done this and still got the error. My mistake was that I had renamed my project, but had not removed the DLL that had been compiled previously. So, the WSP was trying to include that in its deployment. And that DLL wasn't strongly named. Simply deleting it from the bin and obj folders and re-building the wsp fixed that.



