This is a multi-part series. The other parts can be found at
In part II, I wrote about how to get the data out of SharePoint in a dynamic way using a custom ASP.NET web page which did the hard work for us. The last part of this series is getting that code to work on the SharePoint server.
The first step is to create a folder on the server where you will put these files (available at the end of the post). This should be outside your SharePoint directory, something like c:\inetpub\wwwroot\addons would be a good place. Next you need to create a virtual directory on your SharePoint site in IIS which points to that folder. The defaults for the virtual directory will be fine, however from a safety point of view I would recommend it runs in it’s own application pool.
If you just created a ASP.NET application though and put it in there it would fail because the web.config file from SharePoint does some odd things. To get around that you need to few things to it. First clear all the inherited assemblies away (see line 6 below), this has the downside that all the defaults from the machine.config also disappear so you need to add the ones you need back (lines 7 to 13). Next you need to clear all inherited httpModules (see line 19) and lastly you need to increase the trust of this application to full (line 21). Since this is on a virtual directory this has the advantage that you are not messing with the SharePoint config and your SharePoint server will continue to run happily.
1: <?xml version="1.0"?>
4: <compilation debug="true">
7: <add assembly="System, Version=18.104.22.168, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
8: <add assembly="System.Drawing, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
9: <add assembly="System.Web, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
10: <add assembly="System.Web.Services, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
11: <add assembly="System.Xml, Version=184.108.40.206, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
12: <add assembly="System.Core, Version=220.127.116.11, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
13: <add assembly="ListMonkey"/>
16: <authentication mode="Windows"/>
17: <customErrors mode="Off"/>
21: <trust level="Full"/>
That is really all the config you need for the application to run, however don’t forget the config for Slide.Show to run we looked at in parts 1 and 2.
1: Response.ContentType = "text/xml";
Then I call the lists web service of SharePoint which returns the results, which are parsed and rendered to XML (I am unfortunately using XMLNode still when I wrote this, instead of the beautiful XElement stuff… but I digress) and to the screen using:
This XML is in the format Slide.Show expects and so it’s configuration system we setup last time can just use it! All of this gives us a real time integration into SharePoint with Slide.Show!!! :)
As promised the files are available for download. It has occured that the download gets corrupted for some reason, if that is the case I recommend using this download, which is compressed with 7-Zip. NOTE: I have not tested this beyond my own simple tests and your mileage may vary. If you have problems please post a comment here I and will respond.
The files also include the source if you are interested to see what late night coding after months of no coding produces (may not be my finest work… looking over it as I wrote this I felt the need to refractor grow).