asp.net 菜鸟在这里。我正在尝试覆盖/扩展 Gridview 进行分页,如本主题中指定的那样: Probleience with Efficient Gridview paging without datasource control
代码隐藏:
namespace MyCode
{
public partial class _Default : System.Web.UI.Page
{
....
}
}
namespace cly.Web.CustomControls
{
public class clyGridView : GridView
{
...code
}
}
我将如何在我的 .aspx 文件中声明这个新的 gridview?我尝试使用该类作为
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MyCode._Default" %>
<%@ Import Namespace="cly.Web.CustomControls" %>
...
<asp:clyGridView ID="MyResults" runat="server"> </asp:clyGridView>
但这不起作用,我收到此错误
The type or namespace name 'clyGridView' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?)