I got this error today while deploying a solution to a test environment:
"CS0030: Cannot convert type 'Microsoft.SharePoint.WebControls.DelegateControl' to 'System.Web.UI.IAttributeAccessor'"
Disabling SP's custom errors and turning on callstack in the web.config revealed the following:
Line 171: <!-- <div id="login_box">
Line 172: <SharePoint:DelegateControl id="AALogin" runat="server" ControlId="AALogin" __designer:Preview="<span style="display:none"></span>" __designer:Values="<P N='ControlId' T='TrafficDirectorLogin' /><P N='ID' T='TDLogin' /><P N='Page' ID='1' /><P N='TemplateControl' ID='2' /><P N='AppRelativeTemplateSourceDirectory' R='-1' />"/>Line 173: </div> -->
The actual cause of the error was due to the garbage that SharePoint Designer added to the <SharePoint:DelegateControl> tag. Removing that control, which is in comments anyway, or fixing the markup solved the problem.
There's 2 quick lessons from this: (1) don't leave any controls in commented out areas - ASP.NET still processes them during the rendering methods, but the browser leaves them out; (2) Watch out for SharePoint Designer doing black magic to your HTML tags, it has the bad habit of breaking things.
Posted
01-09-2009 1:05 PM
by
Radi A.