当前位置:编程学习 > C#/ASP.NET >>

七年开发,第一次遇到的怪问题,急助

点击查看错误链接:   http://www.skzp.gd.cn/Control.aspx




错误截图
Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0117: 'System.Web.UI.Control' does not contain a definition for 'AppRelativeVirtualPath'

Source Error:

 

Line 120:        public control_aspx() {
Line 121:            string[] dependencies;
Line 122:            ((Control)(this)).AppRelativeVirtualPath = "~/Control.aspx";
Line 123:            if ((global::ASP.control_aspx.@__initialized == false)) {
Line 124:                global::ASP.control_aspx.@__stringResource = this.ReadStringResource();
 

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\23f5c404\df370952\App_Web_control.aspx.cdcab7d2.lkskgfu2.0.cs    Line: 122 
--------------------编程问答-------------------- 7年开发。。。。半年经验的飘过 --------------------编程问答-------------------- 找不到当前控件的AppRelativeVirtualPath 属性
((Control)(this)).AppRelativeVirtualPath = "~/Control.aspx";
--------------------编程问答-------------------- 把那个文件夹下的文件都清除了。
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ --------------------编程问答-------------------- 你这个是不是后来升级到.NET 2.0的??

参考 --------------------编程问答-------------------- 是后来升级到2.0 --------------------编程问答-------------------- 应该是环境的问题,跟程序没有关系!~ --------------------编程问答-------------------- 应该怎样处理呢?求助 --------------------编程问答--------------------
引用 3 楼 kk706 的回复:
把那个文件夹下的文件都清除了。
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\


都不行 --------------------编程问答-------------------- 升级过程中转换出现的问题,参考这个看看
http://mqingqing123.cnblogs.com/archive/2006/01/14/317162.html

如果不行的话,就出问题的这个模块,你重新在.NET 2.0下重新实现下。 --------------------编程问答-------------------- --------------------编程问答--------------------
引用 9 楼 taomanman 的回复:
升级过程中转换出现的问题,参考这个看看
http://mqingqing123.cnblogs.com/archive/2006/01/14/317162.html

如果不行的话,就出问题的这个模块,你重新在.NET 2.0下重新实现下。



看完了,还是解决不了。 --------------------编程问答--------------------
引用 11 楼 peirunou2007 的回复:
引用 9 楼 taomanman 的回复:
升级过程中转换出现的问题,参考这个看看
http://mqingqing123.cnblogs.com/archive/2006/01/14/317162.html

如果不行的话,就出问题的这个模块,你重新在.NET 2.0下重新实现下。



看完了,还是解决不了。


以前的那个是用VS2003写的?后来升级到VS2005或者是VS2008或更高的版本??

--------------------编程问答-------------------- 是的,后来升级了 --------------------编程问答-------------------- 'System.Web.UI.Control' does not contain a definition for 'AppRelativeVirtualPath'
---------------------------------------------
Control并没有这个'AppRelativeVirtualPath'属性啊.
我看了一下,它只有'AppRelativeTemplateSourceDirectory'这个属性。

--------------------编程问答-------------------- 嗯 是环境的问题 有一次我2.0的环境在本机正常 到了服务器3.5的上面 老报错  --------------------编程问答-------------------- 谁能解决啊? --------------------编程问答-------------------- 请使用记事本打开您程序中的Web.Config文件,增加“customErrors mode="Off"”参数设置。(This <customErrors> tag should then have its "mode" attribute set to "Off".)

----------------以下是增加的参数内容----------------

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>


辅助说明:我遇到的升级后的问题一般都是配置文件的错误,我觉得着重看这一块吧 --------------------编程问答-------------------- DAL.Game game1 = new DAL.Game();
            PagedDataSource ps = new PagedDataSource();

            ps.DataSource = game1.GameListByClassId(ClassId).Tables[0].DefaultView;
            ps.AllowPaging = true;
            ps.CurrentPageIndex = Convert.ToInt16(Page);
            ps.PageSize = 54;


//现在分页的功能是OK的,,主要问题是,当记录数小于54时,,,页面显示的数据就只有几条,

如,数据应该为: 50条的话,应该一下子显示50条,结果确只有3条,请问这个是什么地方没有稿好??? --------------------编程问答--------------------
引用 17 楼 confidenceyu 的回复:
请使用记事本打开您程序中的Web.Config文件,增加“customErrors mode="Off"”参数设置。(This <customErrors> tag should then have its "mode" attribute set to "Off".)

----------------以下是增加的参数内容----------------

<!-- Web.Config……


我的程序,早就有这个了,应该不会是这个的问题 --------------------编程问答-------------------- 1.<%@ Control Language="C#" AutoEventWireup="true" CodeFile="link.ascx.cs" Inherits="UserControl_link" %> 检查你的语言是C#吗?
2.代码后置问题CodeFile ,是不是有不能升级的控件需要替换 --------------------编程问答-------------------- (Control)(this) 代表啥? --------------------编程问答--------------------
引用 16 楼 peirunou2007 的回复:
谁能解决啊?
自己 --------------------编程问答-------------------- 七月开发,半年经验的来参观一下 --------------------编程问答-------------------- 这个问题,一般是bin下面编译的控件和你ascx定义的控件不一致造成的,你重新编译下就好了。 --------------------编程问答--------------------


((Control)(this)).AppRelativeVirtualPath = "~/Control.aspx";


Control控件没有AppRelativeVirtualPath 这个属性

要么使用 this.AppRelativeVirtualPath

要么转换为:

((TemplateControl)(this)).AppRelativeVirtualPath = "~/Control.aspx";

--------------------编程问答-------------------- 重装系统和vs吧 --------------------编程问答-------------------- 删掉这个Control.aspx,重写。(原来的代码不是都在么?!) --------------------编程问答-------------------- 7年很高深,0年的飘过 --------------------编程问答--------------------
引用 3 楼 kk706 的回复:
把那个文件夹下的文件都清除了。
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\


看到三楼得头像,我还以为是我自己呢………… --------------------编程问答-------------------- 删了 重写吧 --------------------编程问答-------------------- ((Control)(this)).AppRelativeVirtualPath 

Control没有AppRelativeVirtualPath 这个屌属性啊,你为甚要转成Control啊,建议(this)as ‘你拥AppRelativeVirtualPath的控件 ’,尽量不要使用((Control)(this))这样转, --------------------编程问答-------------------- fw版本问题 --------------------编程问答-------------------- 偷什么懒咯,重新写把 --------------------编程问答-------------------- 临时文件有问题,删除一下临时文件,或者重新生成一下 --------------------编程问答-------------------- control有的,this应该都有。为什么强制转换成control类?
把强制转换去掉,或者转换成其他正确的类型试一试。 --------------------编程问答-------------------- 学习了 
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,