简体   繁体   English

找不到ASP.net ListView控件

[英]Can't find the ASP.net ListView control

I want to extend the ListView control: 我想扩展ListView控件:

using System;
using System.Data;
using System.Collections;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Resources;
using System.ComponentModel.Design;
using System.Globalization;

namespace My.WebControls
{
  /// <summary>
  /// my ListView
  /// </summary>
  [Designer(typeof(System.Web.UI.Design.WebControls.DataBoundControlDesigner))]
  public class MyListView : ListView
  {
  }
}

But compiler does not see this control. 但是编译器看不到此控件。 I include the namespace system.web.ui.webcontrols . 我包括名称空间system.web.ui.webcontrols Do I have to check anything else? 我还需要检查其他吗? I use the framework 3.5. 我使用框架3.5。

The ListView documentation can be found on MSDN and you can see that the control exists in the System.Web.Extensions.dll 可以在MSDN上找到 ListView文档并且可以看到该控件存在于System.Web.Extensions.dll

在此处输入图片说明

Re-check if you have this assembly in your references. 重新检查您的引用中是否包含此程序集。

Here's the full namespaces of a working MyList class 这是正常工作的MyList类的完整名称空间

[System.ComponentModel.Designer(typeof(System.Web.UI.Design.WebControls.DataBoundControlDesigner))]
public class MyCustomListView : System.Web.UI.WebControls.ListView
{
    // ...
}

Because of the DataBoundControlDesigner I also had to reference the System.Design.dll , verify if you also have such reference. 由于存在DataBoundControlDesigner我还必须引用System.Design.dll ,请验证您是否也有此类引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM