App_Code方法不存在错误 [英] App_Code method not exists error

查看:184
本文介绍了App_Code方法不存在错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我的Web应用程序中出现了一些更严重的错误.
当我运行我的应用程序时,即使有方法,App_code中也不存在方法.当我刷新页面时,应用程序正常工作.

错误是:
编译器错误消息:CS1061:"KPI"不包含"GetDiv"的定义,并且找不到找到接受类型为"KPI"的第一个参数的扩展方法"GetDiv"使用指令还是程序集引用?)

源错误:
第50行:Drpdiv.AppendDataBoundItems = true;
第51行:
第52行: Drpdiv.DataSource = K.GetDiv();
第53行:Drpdiv.DataTextField ="Division"
第54行:Drpdiv.DataValueField ="Division"

我的App_code类是KPI
我的代码如下:
KPI K = new KPI();
数据集ds = K.GetDiv();

App_code具有方法GetDiv().但有时却并非总是这样,导致出现上述错误.当错误出现时,我会刷新页面,然后它会工作.可能是什么问题?有什么令人耳目一新的问题吗?请尽快提供帮助.

谢谢

解决方案

尝试从Windows文件夹中删除临时ASP.NET文件,然后检查是否仍然出现错误.


hi I am getting some wiered error in my web application.
when i run my application i am getting method doesnot exist in the App_code eventhough there is method. when i refresh the page then application works.

the error is:
Compiler Error Message: CS1061: ''KPI'' does not contain a definition for ''GetDiv'' and no extension method''GetDiv'' accepting a first argument of type ''KPI'' could be found (are you missing a using directive or an assembly reference?)

Source Error:
Line 50: Drpdiv.AppendDataBoundItems = true;
Line 51:
Line 52: Drpdiv.DataSource = K.GetDiv();
Line 53: Drpdiv.DataTextField = "Division"
Line 54: Drpdiv.DataValueField = "Division"

my App_code class is KPI
my code behind:
KPI K=new KPI();
Dataset ds=K.GetDiv();

App_code is having the method GetDiv(). but its giving the above error sometimes and not always. when the error comes I refresh the page then it works. What may be the problem? is it any refreshing problem? please help regarding this ASAP.

Thank you

解决方案

Try after deleting Temporary ASP.NET Files from your windows folder and check if still you are getting errors.


这篇关于App_Code方法不存在错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆