现在的位置: 首页 > 综合 > 正文

asp.net 2.0 下 基类包括字段 与控件 的类型不兼容 的错误原因

2013年01月14日 ⁄ 综合 ⁄ 共 418字 ⁄ 字号 评论关闭

 

asp.net 2.0 下 基类包括字段 与控件 的类型不兼容 的错误原因

基类包括字段“ucPhotoList”,但其类型(Love0.WebUI.Controls.Space_UserPhotoList)与控件(ASP.controls_space_userphotolist_ascx)的类型不兼容

是由于用到了用户控件时,在主页面的与用户控件必须同时使用 Codebehind 或者 Codefile,

即主页面与用户控件页ascx文件的<%@ Control Language="c#" Inherits="bowoo.BBS.usrctls.footer" CodeBehind="footer.ascx.cs" %>与
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="main.aspx.cs" Inherits="bowoo.BBS.main" %>均使用codebehind或者codefile.

抱歉!评论已关闭.