I know this is an older blog but I really want to get the code to work with a List View web part. I've created a button with SharePoint Designer and added a CEWP. I cannot seem to find the "div id" for the webpart. I've found a webpartid which is a GUID. Is this the same thing? Is this also the same thing you add into the value of the Button?

I know this is a very late comment but still I am going to post this anyway, I have a Data View Web Part that contains Photos too but the photos are not printed, any idea what else should I add? ThanksP.S. Other than the photo issue this works great- thanks for the post!