如何在ListView“ListView1”上指定项占位符?
我用的是vs2008,添加一个listview控件绑定数据源后,调试运行显示:【必须在 ListView“ListView1”上指定项占位符。可通过将控件的 ID 的属性设置为“itemPlaceholder”来指定项占位符。项占位符控件还必须指定 runat="server"。】, 如何在 ListView“ListView1”上指定项占位符?程序代码:
堆栈跟踪: [InvalidOperationException: 必须在 ListView“ListView1”上指定项占位符。可通过将控件的 ID 的属性设置为“itemPlaceholder”来指定项占位符。项占位符控件还必须指定 runat="server"。] System.Web.UI.WebControls.ListView.GetPreparedContainerInfo(Control outerContainer, Boolean isItem, Int32& placeholderIndex) +249 System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(ListViewPagedDataSource dataSource, Boolean dataBinding, InsertItemPosition insertPosition, ArrayList keyArray) +59 System.Web.UI.WebControls.ListView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +693 System.Web.UI.WebControls.ListView.PerformDataBinding(IEnumerable data) +32 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.ListView.PerformSelect() +56 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.ListView.CreateChildControls() +53 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
[ 本帖最后由 beidoujs 于 2011-4-2 22:27 编辑 ]