asp.Net&LT;控制&gt;在目前的情况下不存在 [英] asp.Net <control> does not exist in current context
问题描述
我现在面临一个小的大问题。我已经采取了DropDownList控件ID是在ASP.Net项目drpDownCountries
。问题是,DropDownList控件
放在页面上,在后面的C#文件中的code,同时键入drpDownCountries
,该控件ID是对象的成员列表中列出的控件名称。
但是,在编译项目我得到下面的错误。
I am facing a small big problem. I have taken a dropdownList control and ID is
"drpDownCountries
" in ASP.Net project. The problem is that "The dropdownlist control
is placed on page, in the code behind file of c#, while typing the control name "drpDownCountries"
, this control ID is listed in object member list.
But, in compiling the project I am getting following error.
的 错误: - 名称'drpDownCountries'不在当前情况下存在 的
我已签这个东西在不同的机器了。但同样的错误发生。我不明白什么是背后的原因。
I have checked this thing on different machines too. But same error is occurring. I do not understand what is the reason behind that.
推荐答案
在ASPX(或ASCX)右键单击文件,并选择转换为Web应用程序(或类似的东西)。这将迫使设计文件的刷新。
Right-click on the ASPX (or ascx) file, and select Convert to web application (or something like that). That will force a refresh on the designer file.
这篇关于asp.Net&LT;控制&gt;在目前的情况下不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!