The Good, the Bad and the DataViewWebPart
Been wrestling lately with Sharepoint's DataViewWebPart (DVWP, from now on). I'm still pretty ambivalent about it.
- Easy to set up - just add a list as a web-part, open it in Frontpage, right-click and Convert to XSLT.
- Very customizable. I like XSLT. I can tweak it any way I want, generating custom rendering for my fields that would otherwise require me to write a custom web-part or a custom FieldType, which is too much hassle.
- Presentation only. All the data-access logic is taken care of behind the scenes, and I have all the properties of my list items as XSLT parameters to play with as I choose.
- Not Portable. If I build a menu off of a list (as detailed here, excellent article), that DVWP is linked to the list's GUID. If I now want to copy that DVWP to a different subsite, I have to edit the hardcoded GUID or start messing with passing GUIDs as parameters and whatnot.
- Messy, messy, messy. Tweaking unformatted XSLT in FP2003's Code view is a big, big pain - and a slip of the keyboard can make the DVWP unrenderable with no real explanation where you screwed up.
- Maintainability is hell. Code is embedded directly in the page. If I want that DVWP on every page in my site (for the menu), I have to add it to every page manually, and update every change manually - even if I export it to a DWP file and just import to each page, I still need to update manually when things change. Anyway, it's a break from the content/presentation split that ASP.NET is pushing.
Right now I've given up on the DVWP approach and simply wrote a web-part in C# - it's portable, integrates well with my source-control-provider-of-choice, and the distinctions between unit of functionality and the page it resides in is clear.
Anyone have any supporting/opposing POVs? Any hints or tricks that make DVWPs more useful outside of the single-site scope?