Archive for November, 2008

Microsoft releases new ASP.NET charting control for … FREE!

Posted on 30. Nov, 2008 by .


This past week Scott Guthrie announced a new ASP.NET charting control from Microsoft for free.  Details are in Scott’s blog posting, from the screen shots it looks quite capable.  I’m anxious to have an opportunity to kick the tires on this control, thanks MS!

Continue Reading

Microsoft Wireless Laser Desktop 7000

Posted on 19. Nov, 2008 by .


I found it time to retire the venerable Microsoft Wireless Optical Desktop Elite made famous from the cover of Code Complete: A Practical Handbook of Software Construction:

Code Complete

At the time I purchased it, about 3 years ago, I believed it to be the cats meow of keyboards.  And I was probably right.  I usually am ;-) .  Anyway, enough self indulging.  I tired of this keyboard this year, and when I saw the announcement for the Microsoft Wireless Laser Desktop 7000 I had to have one.  But I didn’t have to have one for the original $129.99 asking price.  Recently the price has dropped significantly under that original figure, and I was able to pull the trigger.  Take a moment and marvel at the beauty of this thing:

Wireless Desktop 7000

Ewwww.  You’re drooling.  Here, let me help:


Okay.  Enough gratuitous use of images.  In any event, I have been very pleased with this keyboard all-in-all.  I’ll give you the things I’m not crazy about first though:

  • Out of the box, the rechargeable battery for the mouse didn’t work.  So the theory is this desktop set comes with a mouse charger that you can plop that mouse on and recharge the battery.  Seems like a great idea.  Except when I put in the included rechargeable battery, and put the mouse on the charger, the mouse blinks fast red.  Translation:  Charging error.  Solution?  Drop a normal alkaline AAA in the mouse and throw the charger away.
  • The cool "aero looking" plastic that surrounds the keyboard scratches VERY easily.  So easily in fact that it comes pre-scratched from the factory. 
  • The escape key and other function keys are a bizarre size.  Tiny little things.  Although I still find them easy enough to hit.
  • The space bar is a bit loud.  Not necessarily on its own, but when compared to the amount of noise generated from the other keys on the keyboard, the space bar seems to generate twice as much noise.  Not a big deal, just a small nitpicking thing.  Its NOWHERE NEAR as loud as my Elite was!

Okay, now for the good stuff, things I like:

  • Cannot be overstated – the thing is by far the best looking keyboard I have owned to date.  Goes superbly with my Vista desktop.  Very important.
  • This thing is comfortable.  I have been a latecomer to the whole curved setup of keyboards, but I purchased one of the Microsoft Wireless Laser Desktop 3000 kits for at work several months back and ever since I’ve found the normal "flat" keyboards just plain uncomfortable to type on.  Furthermore, my typing speed seems to go up significantly on a curved keyboard.
  • I really like the amount of pressure that each key requires.  The Elite required a ridiculous amount of key pressure and I would find my fingers quite fatigued at the end of the day.  I have not had any such problem with the Laser 7000.
  • This is by far the best looking keyboard I have owned to date.
  • People have complained about the new tiny 2.4 GHz USB receiver, but I actually like it.  I’m tired of the big honking receiver that has come with previous keyboard sets.  The reception is just fine at my desk, mind you my keyboard is within about 4 feet of the receiver, and I have it plugged into a USB port on the front of my desktop.  Haven’t tried plugging it in the back, maybe I would run into problems then, but I doubt it.

Take my advice for what its worth, but if you are a fan of Microsoft hardware, which I undoubtedly am, I think you’ll be very happy with the Wireless Desktop Laser 7000. 

Continue Reading

"The security validation for this page is invalid"

Posted on 18. Nov, 2008 by .


I’m currently working on a SharePoint project that makes extensive use of programmatically setting ListItem ACL’s.  There is a List Event Handler which sets ACLs on the ItemAdded event, but then there is an administrative interface that enables administrators to reassign list items to another user which effectively means replacing the ACLs for the ListItem to give another user Contribute.

In any event, I keep encountering the dreadful "The security validation for this page is invalid" error when trying to perform the ACL updates, specifically from web parts (haven’t seemed to have this issue on list event handlers).  Well it appears that I’ve finally come up with the magic combination of fixes.  There are several blog postings out there indicating that you should use "AllowUnsafeUpdates" on your SPWeb object.  This seems to fix things for many people, however, the code I was working on calls "BreakRoleInheritance".  Apparently that bugger ends up reverting the "AllowUnsafeUpdates" flag back to false after you call it!

Here’s the information that Paul Yau shared in a thread on the MSDN forums which took care of my issue, thanks for sharing Paul!

Problem Description:


When you call SPList.BreakRoleInheritance(false) from an HTTP GET request, although you have specified SPWeb.AllUnsafeUpdates=true, you will still be thrown an exception

Updates are currently disallowed on GET requests. To allow updates on a GET, set the ‘AllowUnsafeUpdates’ property on SPWeb.



This is by design limitation of SPList.BreakRoleInheritance

BreakRoleInheritance does it work in two steps. First, it needs to revert its permission to have same permission settings as parent (this is a less expensive operation, and give the list a fresh start on its road to unique permission). Later it checks CopyRoleAssignments parameter. If it is false, it takes an extra step to clean up permission on the list. A side effect of step 1 is that it dirties some internal objects in SPWeb, and cause them to be recreated. Unfortunately, the re-creation of those internal objects cause SPWeb.AllowUnsafeUpdates to have a default value which is false. That is, SPWeb.AllowUnsafeUpdates is reset in middle of call to SPList.BreakRoleInheritance, therefore we got the exception.



There are two possible workarounds to the issue:

1.       Call SPList.BreakRoleInheritance from a HTTP POST request. That is, we can first have a button on UI and have users to click. In response to users’ click, we call SPList.BreakRoleInheritance. There is a first HTTP GET request by which, SharePoint has a chance to embed some digest to validate requests on return (HTTP POST). Therefore, we no longer need to set SPWeb.AllowUnsafeUpdates=true. This is recommended approach from security perspective.

2.       First call SPList.BreakRoleInheritance(true). Then, use custom code to clean up permission and create your own permission set for the list as needed. The sample code are:

SPWeb web = SPControl.GetContextWeb(this.Context);

SPListCollection lists = web.Lists;

//Guid docLibGuid = lists.Add("Doc Lib Sample 1", "Doc Lib Desc", SPListTemplateType.DocumentLibrary);

//SPList docLib = lists[docLibGuid];

SPList docLib = lists["Doc Lib Sample 1"];

//docLib.ParentWeb.AllowUnsafeUpdates = true;

docLib.BreakRoleInheritance(true); //Exception throw here when the parameters is "false"

web.AllowUnsafeUpdates = true;

SPRoleAssignmentCollection roleAssigns = docLib.RoleAssignments;

for (int i = roleAssigns.Count-1; i >= 0; i–)




Continue Reading

PNY Attache 1G USB flash survives washing machine

Posted on 18. Nov, 2008 by .


I’ve been in the habit the past few weeks of leaving items in my pockets which end up on an adventure through the washing machine.  The latest participant was my PNY Attache 1G USB Flash drive.


I thought for certain it was a goner.  I left it on my desk overnight to dry out and gave it a shot this morning, wha-la!  Came right up with my Portable Apps menu.  Very cool!

Continue Reading

Where is my storage space going?

Posted on 17. Nov, 2008 by .


Over the past few weeks I have had several instances of where I need to know how where space is being allocated within a site collection.  For instance, one client has seen tremendous growth of the site collection database, but is not sure how/where/why the space is being used.  Another client has also seen rapid content database growth, and would like to make sure the space allocation is legitimate.

On the surface it did not appear that SharePoint had an out-of-the-box solution for this, which seemed criminal.  A few products out there seemed to fill that void:

However, finally, today I came across a solution that IS right there out-of-the-box.  While researching a completely unrelated issue, I discovered the _layouts/storman.aspx file, as referenced here.  The trick is that you must have a site collection quota specified in order to use this feature.  Once you configure a quota you will see "Storage space allocation" located under "Site Collection Administration" in Site Settings:


When you click on "Storage space allocation" you receive a page similar to the following (but without the huge black block protecting the innocent):


You can see that it shows the amount of space used in relation to the configured site quota, and then by default displays the amount of space being consumed by various document libraries in descending size!  Fantastic!

Definitely not as complete as the Nintex or Quest Software solutions, but its great that there is in-fact an out-of-the-box way of achieving this.

Continue Reading