日期:2014-05-19  浏览次数:20364 次

编写ascx自定义控件,运行却出错??
编写了ascx控件,将*.ascx.cs文件删除,同时,在ascx的html下,
将 <%@control   %> 保留,其余的删除,但是运行的时候,却出现以下错误:
*.ascx.cs文件找不到。
为什么?

------解决方案--------------------
<%@control %>
里面还是有定义

CodeFile= "***.ascx.cs "
------解决方案--------------------
<%@ Control Language= "C# " AutoEventWireup= "true " CodeFile= "WebTopym.ascx.cs " Inherits= "shinyway_WebTopym " %>

CodeFile= "WebTopym.ascx.cs " 这个指定你的cs文件的阿
------解决方案--------------------
此有一例:
ascx 文件
<%@ Control Language= "c# " AutoEventWireup= "false " Codebehind= "incHeader.ascx.cs " Inherits= "pdn.inc.incHeader " TargetSchema= "http://schemas.microsoft.com/intellisense/ie5 " %>

aspx 文件
<%@ Page CodeBehind= "idesign.aspx.cs " Language= "c# " AutoEventWireup= "false " Inherits= "pdn.idesign " %>
<%@ Register TagPrefix= "uc1 " TagName= "incHeader " Src= "inc/incHeader.ascx " %>
<uc1:incheader id= "IncHeader1 " runat= "server "> </uc1:incheader>
------解决方案--------------------
你把CodeFile删干净了?。。。。