in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

George Bonney's SharePoint Blog

SharePoint Layouts Page - Exception Message: Value cannot be null. Parameter name: g

Having just wasted over an hour, I felt it worth sharing my resolution to this gem of an error. Typically, the error is quite generic, but in my case, the problem was caused by including SharePoint controls that relied upon particular querystring entries existing – namely, List=GUID.

So – a bit of background… I am creating an additional list settings page for managing some custom developed stuff – and so I took a copy of an existing list settings page so that I could use the same controls and formatting to get the section effect.  In doing this, I left the main content in there (just to prove that I could see my page and it was happy with my code-behind reference), deployed the layouts page to the 12 folder and then pointed straight to it in the browser.  In theory this should just work – it was, of course, a simple initial test … but – after adding the OK button event handler to my code-behind class, among other things, I ended up with the error above.  After an amount of fiddling around I worked out that the “SharePoint:FormattedStringWithListType” control relies upon the List= querystring entry but doesn’t provide any kind of appropriate message to let you know that’s what the problem is.

I hope this saves you someone some time!

Comments

No Comments

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts