0
我试图在asp.net中扩展中继器控制。例如,我想添加按钮,将控件中的颜色从黑色变为红色(这只是一个示例)。通过添加按钮来扩展中继器
我创建网站的用户控制和改变继承自
public partial class MyRepeater : System.Web.UI.UserControl
到:
public partial class MyRepeater : Repeater
ASCX:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyRepeater.ascx.cs" Inherits="System.Web.UI.WebControls.Repeater" %>
然后在ASCX我想添加的按钮,但有编译时出错:
ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).
我怎样才能easilly扩展中继器的一个按钮(我需要扩大原因在实际的例子中,这个按钮将做别的事情,所以其他解决方案,chage颜色不会帮助我)。
感谢任何提示
仍然同样的错误 – gruber
改变,以反映错误@gruber,并添加了你需要看看_可能会敲你一个快速的服务器控制扩展中继器,但我认为通过阅读MSDN中的文章你会获得更多收益 –