Tue, November 20, 2007, 07:45 AM under Orcas
If you open your existing Beta 2 web projects with VS 2008 RTM
, and you were using the new ListView (one of the 3 new web controls
), you may face the following error:System.InvalidOperationException: An item placeholder must be specified on ListView 'ListView1'. Specify an item placeholder by setting a control's ID property to "itemPlaceholder". The item placeholder control must also specify runat="server".
There are two changes to be aware of:
1. Instead of
(which is probably what you are using from Beta 2), you must now change the id to be equal to
. Make this change and your project will compile.
2. The control that has the
does not get rendered at runtime anymore (it gets removed and replaced with multiple instances of the
). So if you were using for example a
and had some CSS on it for the
, this styling is now lost. The solution, of course, is to place the outer element (e.g.
) on its own and within it place a
you set to "itemPlaceholder".
An example of both of the above:
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
Easy once you know how ;-)