简体   繁体   中英

Can't find the ASP.net ListView control

I want to extend the ListView control:

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 . Do I have to check anything else? I use the framework 3.5.

The ListView documentation can be found on MSDN and you can see that the control exists in the System.Web.Extensions.dll

在此处输入图片说明

Re-check if you have this assembly in your references.

Here's the full namespaces of a working MyList class

[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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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