我是靠谱客的博主 单薄滑板,最近开发中收集的这篇文章主要介绍CodeFileBaseClass 属性,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

asp.net 2.0 中,今天遇到了一个错误:

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)

原因是我的 CodeBehind 类继承了自定义的页面基类。按理以往也不该出错的,查了下 google:

http://forums.asp.net/t/941553.aspx

解决办法是:在 aspx 的 Page 指示节中加一个 CodeFileBaseClass 属性指名自定义的页面基类。
例如:

<% @ Page Language = " C# "  AutoEventWireup = " true "  
    Inherits
= " ZbUrbanPlanning.Web.admin.AddressBook.OrgManage "  
    CodeFile
= " OrgManage.aspx.cs "
    CodeFileBaseClass
="ZbUrbanPlanning.Web.PageBase"   %>

最后

以上就是单薄滑板为你收集整理的CodeFileBaseClass 属性的全部内容,希望文章能够帮你解决CodeFileBaseClass 属性所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(80)

评论列表共有 0 条评论

立即
投稿
返回
顶部