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

江门拓胜科技 2011-07-04 08:23:33
点击查看错误链接: 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
...全文
687 36 打赏 收藏 转发到动态 举报
写回复
用AI写文章
36 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuxiaoke2009 2011-07-06
  • 打赏
  • 举报
回复
学习了
lu_da_nan 2011-07-06
  • 打赏
  • 举报
回复
control有的,this应该都有。为什么强制转换成control类?
把强制转换去掉,或者转换成其他正确的类型试一试。
beautiful_melody 2011-07-04
  • 打赏
  • 举报
回复
7年很高深,0年的飘过
  • 打赏
  • 举报
回复
删掉这个Control.aspx,重写。(原来的代码不是都在么?!)
generhappy 2011-07-04
  • 打赏
  • 举报
回复
重装系统和vs吧
让IE灭亡 2011-07-04
  • 打赏
  • 举报
回复


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


Control控件没有AppRelativeVirtualPath 这个属性

要么使用 this.AppRelativeVirtualPath

要么转换为:

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

xiaoyu821120 2011-07-04
  • 打赏
  • 举报
回复
这个问题,一般是bin下面编译的控件和你ascx定义的控件不一致造成的,你重新编译下就好了。
sxg456 2011-07-04
  • 打赏
  • 举报
回复
七月开发,半年经验的来参观一下
net5354 2011-07-04
  • 打赏
  • 举报
回复
[Quote=引用 16 楼 peirunou2007 的回复:]
谁能解决啊?
[/Quote]自己
子夜__ 2011-07-04
  • 打赏
  • 举报
回复
(Control)(this) 代表啥?
fangbin678 2011-07-04
  • 打赏
  • 举报
回复
1.<%@ Control Language="C#" AutoEventWireup="true" CodeFile="link.ascx.cs" Inherits="UserControl_link" %> 检查你的语言是C#吗?
2.代码后置问题CodeFile ,是不是有不能升级的控件需要替换
江门拓胜科技 2011-07-04
  • 打赏
  • 举报
回复
[Quote=引用 17 楼 confidenceyu 的回复:]
请使用记事本打开您程序中的Web.Config文件,增加“customErrors mode="Off"”参数设置。(This <customErrors> tag should then have its "mode" attribute set to "Off".)

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

<!-- Web.Config……
[/Quote]

我的程序,早就有这个了,应该不会是这个的问题
zhf97421 2011-07-04
  • 打赏
  • 举报
回复
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条,请问这个是什么地方没有稿好???
confidenceyu 2011-07-04
  • 打赏
  • 举报
回复
请使用记事本打开您程序中的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>


辅助说明:我遇到的升级后的问题一般都是配置文件的错误,我觉得着重看这一块吧
江门拓胜科技 2011-07-04
  • 打赏
  • 举报
回复
谁能解决啊?
酷儿 2011-07-04
  • 打赏
  • 举报
回复
嗯 是环境的问题 有一次我2.0的环境在本机正常 到了服务器3.5的上面 老报错
laolaolai 2011-07-04
  • 打赏
  • 举报
回复
'System.Web.UI.Control' does not contain a definition for 'AppRelativeVirtualPath'
---------------------------------------------
Control并没有这个'AppRelativeVirtualPath'属性啊.
我看了一下,它只有'AppRelativeTemplateSourceDirectory'这个属性。

江门拓胜科技 2011-07-04
  • 打赏
  • 举报
回复
是的,后来升级了
暖枫无敌 2011-07-04
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 peirunou2007 的回复:]

引用 9 楼 taomanman 的回复:
升级过程中转换出现的问题,参考这个看看
http://mqingqing123.cnblogs.com/archive/2006/01/14/317162.html

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



看完了,还是解决不了。
[/Quote]

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

江门拓胜科技 2011-07-04
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 taomanman 的回复:]
升级过程中转换出现的问题,参考这个看看
http://mqingqing123.cnblogs.com/archive/2006/01/14/317162.html

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


看完了,还是解决不了。
加载更多回复(16)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧