Lately I was looking for some example on how to replace the attachment in document library (SP2010) without changing the version number but without any results. If you’ve faced the same problem here is the solution
Few days ago I faced with the problem of linking to default view page of custom document library (for purposes of redirection with Source parameter after uploading new document and filling it’s meta data form).
At first I tried using SPList.Forms collection indexed with PAGETYPE enumeration as I found in article “How To Always Link to the Right Application Pages”. But every time I was trying to get the default view object this way:
var defaltViewUrl = documentLibrary.Forms[PAGETYPE.PAGE_DEFAULTVIEW].Url;
As I wrote previously the one of my recent projects was to create a new upload page for specific Document Library (based on custom list template) that will use Telerik Upload component (Silverlight) and will entirely replace OOB
upload.aspx page. Looking for some suggestions how to do this I found few solutions but none of them met my criteria:
- Using SharePoint Designer for customizing default upload page - I’m not sure if this could apply to document library; I also rejected this option from start as non-programmatic approach because of problems in future development and maintenance
- New document template redirection trick - looks simple but this wasn’t enough elegant solution for me (I know - who cares, it’s SharePoint after all… ;-)
- Creating a custom action in ribbon with custom rendering template for ribbon - very nice solution when you want to change upload pages for all lists on farm, but this is not applicable in my case; still “Add new document” link at the bottom remains
There were also other approaches like changing all related links with jQuery on client side but I would prefer some simple, elegant and server side solution that will not cause any problems on migration to the next version of SharePoint.
Welcome on my new blog (and also the first one).
In few days I plan to picture some of my first experiences with development in SharePoint 2010. They are related with my current project - custom upload form with Telerik upload control (Silverlight) that will entirely replace the standard OOB upload mechanism for custom document libraries.