Wednesday, June 24, 2009

How to unsubscribe (or remove) yourself from a SharePoint 2007 alert?

In SharePoint one can subscribe to any document libraray or list to be sent alerts when changes occur such us additions, deletions, and updates. This is done by choosing "Actions" => "Alert Me".


If one wishes not to receive alerts anymore, it is not that apparent how to do it. Well, you would need to go to "Site Actions" => "Site Settings" => "User Alerts". Choose the user in question and subsequently delete him/her from the appropriate list or document library alert.

Wednesday, May 13, 2009

Presentation to VanSPUG on Enhancing SharePoint with Silverlight 2.0

VanSPUG (Vancouver SharePoint User Group) is less than one year old. I can proudly say that I was a catalyst in the establishment of this young user group when I helped Peter McFarlane organize the launch event on September 17, 2008 at my BCIT workplace. Since then I have attended most of their meetings. Therefore, it was certainly an honor for me to be a speaker for the first time.


I had a blast when I presented at VanSPUG yesterday evening on the topic of "Enhance SharePoint with Silverlight 2.0". The event started just after 6:30 PM and ended promptly at 8:15 PM becuase we had to vacate the meeting room. Sherman was my host who did a good job introducing me at the start. The event was attended by about 30 people and was held at the Microsoft offices at 1111 West Georgia Street in downtown Vancouver. I would have liked to have questions from those who attended. Actually, I cannot recall even a single question. Oh well ...

For those who are interested in the resources clck here to download my powerpoint presentation + examples.

Friday, March 6, 2009

Enabling Entity Framework (ADO.NET Entity Data Model) in a SharePoint 2007 web.config file

The Entity Framework is considered to be the modern day successor to "LINQ to SQL". If you wish to use this technology in a SharePoint 2007 web part you will need to tweak your web.config file to accomodate the new assemblies that are associated with the Entity Framework. Here are the changes that you need to apply to your web.config file:


1) Add the following tags to the <compilation><assemblies> section:

<add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

<add assembly="System.Data.Entity.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

<add assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />

2) Add the following tags to the <compilation> section just under the closing </assemblies> tag:

<buildProviders>

<add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />

</buildProviders>

Tuesday, March 3, 2009

How can you get the thumbnail for an image in your SharePoint picture library?

This is much easier than I had imagined. At first I thought I need to do some programming with the SharePoint Object Model APIs. It turned out to be nothing of the sort.


Let us assume that you have a photograph located in your picture library named "pictures" at this URL:

http://www.spserver.com/spsite/pictures/joe_smith.jpg

The thumbnail for the above picture is located at:

http://www.spserver.com/spsite/pictures/_t/joe_smith_jpg.jpg

As you can see, here's what I did:

1) tag a directory "_t" to the the URL just before the filename.

2) tag "_jpg" to the filename just before the extention. This would have been "_gif" if you are dealing with a GIF file.

Voila, if you point your browser to this tweaked URL you will get your thumbnail.

You will get a larger image if you use _w instead of _t.

Painless eh. . .

Wednesday, February 18, 2009

How to use JavaScript to close an IE7 browser window without seeing the confirmation dialog?

<a href="javascript: window.open('','_parent','');window.close();">Close this window!</a><br />

Thursday, December 4, 2008

What is a quick way to get a .NET assembly's PublicKeyToken?

The quick and dirty way is to go into the .NET command prompt and type the following:


sn -T MyDotNetAssembly.dll

The above utilizes the strong name utility that comes with the .NET Framework.

Wednesday, November 26, 2008

Download tracking with WSS 3.0

WSS 3.0 does not have a mechanism for tracking who downloads which files with authenticated users. When I got confronted with this task, I decided to create a web user control that reads all the files in a document library and subsequently displays the file names using a series of "LinkButton" controls. I then attached this web user control to a SharePoint WSS 3.0 web page. I decided against using a Hyperlink object in favor of a LinkButton ASP.NET control for the following two reasons:


1) With a HyperLink ASP.NET control, users can right-click on the anchor and choose "Save target as" to save the file. This is not desirable because no event is triggered when that happens. On the other hand, a LinkButton control does not produce a right-click popup in a browser leaving the user with no choice but to click on the link.

2) I needed to put some business logic behind the click event of the LinkButton. The business logic essentially saves statistics along the lines of: timestamp, host address, user ID, and filename.