我试图在ASP.NET Web窗体GridView中使用属性VirtualItemCount进行自定义分页,它给了我这个错误
Severity Code Description Project File Line Suppression State
Error CS1061 'GridView' does not contain a definition for 'VirtualItemCount' and no extension method 'VirtualItemCount' accepting a first argument of type 'GridView' could be found (are you missing a using directive or an assembly reference?) dms D:\project\Screen\ToDoList.aspx.cs 100 Active
当我创建新项目时,它的工作正常,但在我当前的项目中,它似乎没有定义,我搜索了很多没有类似于我的情况。
我是否需要添加某些装配参考或缺少设置?
<asp:GridView ID="GridView1" runat="server" CssClass="Grid"
PageSize="10"
AllowPaging="true"
AutoGenerateColumns="false" OnPageIndexChanging="GridView1_PageIndexChanging">
<AlternatingRowStyle />
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Date" HeaderText="Date" />
<asp:TemplateField>
<ItemTemplate>
<input type="button" value="Edit" class="button" />
<input type="button" value="delete" class="button" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
看起来像这样
这些是我的设置
答案 0 :(得分:0)
我只是转到Properties -> Application
并将Target Framework
从.NET Framework 4
更改为.NET Framework 4.5
并且有效