Did you know that if you "close" a web part, it doesn't really go away? Instead, it's running invisibly in the background of your page every time the page loads. YIKES!!
Firstly, this seems to me like a horrible waste of system resources. I know from personal experience early on in my SharePoint career that it's really easy to believe that the web parts are gone when you close them. Instead, you must be sure to "delete" the web part so that it is removed from the page.
I've only found one way to locate these closed web parts, and it's not anywhere in the UI. You have to type "?contents=1" into the end of your page address in the web browser. So, for example, if your page's URL was http://localhost/pages/default.aspx, then you would type http://localhost/pages/default.aspx?contents=1.
So, here's my opinion on this--just in case someone from the SharePoint Team runs across this post. If closing a web part is going to keep it running for each page load, then there must be an intuitive way to manage these closed web parts that doesn't require remembering a URL hack. Manipulating querystrings by hand in a web site is actually a form of hacking. Back in the olden-days (yes, I'm dating myself here), inexperienced developers actually didn't safe-guard against users becoming entirely different people by simply changing the "userid" value in a querystring. Granted, typing "contents=1" at the end of your URL is actually pretty harmless, but from a usability stance, why should we have to?
For anyone who doesn't think this is a big deal (first of all, allow me to slap you for your tollerance of wasted system resources and potentially slower load times), consider for a moment what would happen if you closed a bunch of web parts and then uninstalled the web part feature? That's happened to me before. Suddenly, every page on your site with that hidden web part won't load anymore. All you get is an error page. With no navigation at your disposal and no way to see the closed web parts in administration pages, you're really pretty much stuck! This actually happened to me one time. It cost me HOURS of development time just to figure out what was going on!!
When I have time, I'm going to investigate adding a security-trimmed URL to my master pages that will provide Administrators a quick link to see the hidden contents of the current web page. When I get that tag, I'll be sure to share it with you all.
Happy Coding!
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment