问题描述
所以,我有另一种面条饼刷(我反正)。
我想创建一个CMS自己的自定义控制我只有部分源代码问题(即样本厂商都提供给我)。基本上,我创建了一个名为 DataDefinitionContent
延伸 ControlBase
类。现在,从我可以从元数据争取, ControlBase
扩展用户控件
,所以我还以为这将不运行一台戏。任何人都可以摆脱任何光线为什么这可能不是为我工作?
我的类别:
公共部分类DataDefinitionContent:ControlBase,ICustomControl< DataDefinition>
{
...的东西
}
ControlBase:
使用系统;
使用System.Web.UI程序;
命名空间CMS.Web
{
公共类ControlBase:用户控件
{
...的东西
}
}
我的ascx文件:
<%@控制语言=C#AutoEventWireup =真正的代码隐藏=DataDefinitionContent.ascx.cs
继承=CMS.Admin.WebUI.CustomControls.DataDefinitionContent,CoA.Admin.WebUI,版本= 1.0.0.0,文化=中立,公钥=空%GT;
我得到的错误:
尝试把你的部分类
命名空间CMS.Web
So I have another noodle-scratcher (for me anyway).
I'm trying to create my own custom control in a CMS I only have partial source code for (i.e. samples the vendor has supplied to me). Basically I have created a class called DataDefinitionContent
which extends ControlBase
. Now, from what I can garner from the metadata, ControlBase
extends UserControl
, so I would have thought this would run without a drama. Can anyone shed any light on why this might not be working for me?
My Class:
public partial class DataDefinitionContent : ControlBase, ICustomControl<DataDefinition>
{
... Stuff
}
ControlBase:
using System;
using System.Web.UI;
namespace CMS.Web
{
public class ControlBase : UserControl
{
... Stuff
}
}
My ascx file:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DataDefinitionContent.ascx.cs"
Inherits="CMS.Admin.WebUI.CustomControls.DataDefinitionContent, CoA.Admin.WebUI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" %>
The error I'm getting:
Try putting your partial class in
namespace CMS.Web
这篇关于我的控制"在这里不允许的,因为它不会扩展类'System.Web.UI.UserControl'"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!