日期:2014-05-17  浏览次数:20426 次

web用户控件怎么才能使用基类PageBase?
我在web用户控件使用了基类,出现错误。

.cs里的
public partial class wucHead :PageBase

.aspx里的
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wucHead.ascx.cs" Inherits="wucHead" %>

错误:

编译器错误消息: ASPNET: 请确保此代码文件中定义的类与“inherits”属性匹配,并且该类扩展的基类(例如 Page 或 UserControl)是正确的。

行 12: public partial class wucHead :PageBase

------解决方案--------------------
用户控件,一般会 有个基类 UserControl,好像无法自己定义 自己的基类。除非搞清楚 UserControl是怎么定义的,能不能重写 里面的方法。