An item placeholder must be specified on ListView – VS2008 RTM

This errors pops up as soon as you switched from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM. Here’s the exact 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”.

To fix this, replace every itemContainer occurrences with itemPlaceholder, recompile and it should work. Also note that the control which is targeted as itemPlaceholder does not render CSS or other attributes anymore, you have to set them on surrounding HTML tags now like a div or ul.

5 comments ↓

#1 Berkut on 11.27.07 at 10:17 am

This solution works fine for me!

#2 Ten Tips for a Happy Upgrade to Visual Studio 2008 (Release) - Jon Galloway on 11.28.07 at 11:04 am

[…] Moth has some info on this, Andreas Kraus explains the issue for both the Item Placeholder and the Group […]

#3 Dmitry on 12.09.08 at 5:14 pm

What are you talking about??? Can you describe more clearly! What is itemContainer, what is itemPlaceholder?

#4 Mehboob bhai on 06.05.09 at 8:00 am

thanks mate

#5 mhh12 on 10.26.09 at 5:05 pm

If you use VWD 2008 Express, you get this error message for a very simple reason. You didn’t finish clicking through the set up of ListView.
Go click on that tiny little box at the upper righthand corner of the ListView with the > sign in it,
Go click on configure listview,
Select a layout and a style and a paging system,
(when I don’t want any of the selections, I click on the selections and then erase the clickings, ie you have to exercise through the page to get rid of the error, you don’t have to pick anything)
Click OK and the error will go away.
In the source view you will see a lot more code. The place marker term won’t be there.

Leave a Comment