“ControlName”的名称在当前上下文中不存在。 [英] The name of 'ControlName' does not exist in the current context.

查看:95
本文介绍了“ControlName”的名称在当前上下文中不存在。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Web应用程序并从现有的asp.net项目中传输了代码。当我编译它时,我收到了数百个错误:在当前上下文中不存在ControlName的名称。愿意得到提示来解决这类问题。谢谢。

I created a web application and transferred the code from an existing asp.net project. When I compiled it, I received hundreds of errors like: The name of 'ControlName' does not exist in the current context. Willing to get hints to solve this kind of problem. Thanks.

推荐答案

1)回到原始应用程序。

2)找到你的错误列表显示的第一个控件不是在新项目中存在。

3)复制它。

4)粘贴到新的应用程序中。

5)重复(1) )直到错误消失。
1) Go back to the original application.
2) Find the first control your error list shows as "does not exist" in the new project.
3) Copy it.
4) Paste into your new application.
5) Repeat from (1) until errors disappear.


My problems got solved by referring to the thread at http://stackoverflow.com/questions/706603/the-name-controlname-does-not-exist-in-the-current-context/1981228#1981228[^].
What I did was to Right-click on the parent aspx file. In the pop-up menu, select Convert to Web Application. Then, re-compiled the project.
Thanks for all of reviewers who posted their comments and provided possible solutions.


排除引用相同代码隐藏文件的任何其他页面,例如您复制并粘贴的旧页面。
exclude any other pages that reference the same code-behind file, for example an older page that you copied and pasted.


这篇关于“ControlName”的名称在当前上下文中不存在。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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