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

来源:互联网 发布:七天网络学生查分 编辑:程序博客网 时间:2024/05/16 19:33

 

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.
原创粉丝点击