Intellisense没有出现在代码背后的新控件中

时间:2022-08-25 21:48:27

I've added a label control to a webform. It appears when I run the page but when I try to reference it using the codebehind, I get no intellisense and the code I write somehow doesn't work. I've verified the project is running in debug, that debug compilation is set in the web.config. In fact, I can debug all pages. However, when i go to this page, debugging runs over it as if there is no breakpoint set. Also, on the breakpoint, it says 'The breakpoint will currently not be hit. The source code is different from the current code' which has the be the main issue. Not sure why that's happening as I recompiled the whole project.

我已经为webform添加了标签控件。它出现在我运行页面但是当我尝试使用代码隐藏引用它时,我得不到intellisense,我写的代码不能用。我已经验证了项目是在调试中运行的,调试编译是在web.config中设置的。实际上,我可以调试所有页面。但是,当我转到此页面时,调试会在其上运行,就像没有设置断点一样。此外,在断点处,它说'断点当前不会被击中。源代码与当前代码不同,后者是主要问题。当我重新编译整个项目时,不确定为什么会这样。

I have this at the top of the page:

我在页面顶部有这个:

print("<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MemberSearch.aspx.cs" Inherits="Portal.EmployerPortal.MemberSearch" Debug="true" %> ");

print(“<%@ Page Language =”C#“AutoEventWireup =”true“CodeBehind =”MemberSearch.aspx.cs“Inherits =”Portal.EmployerPortal.MemberSearch“Debug =”true“%>”);

Any ideas?

6 个解决方案

#1


In the past I've had problems with this because the auto-generated designer files were bad. Try deleting them and then allow VS to recreate them, this may fix the problem.

在过去,我遇到了问题,因为自动生成的设计器文件很糟糕。尝试删除它们然后允许VS重新创建它们,这可能会解决问题。

#2


Try doing a Build -> Clean Solution

尝试做一个Build - > Clean Solution

#3


This is a common problem with VS. Usually the cause is the .designer files are not re-generated due some sort of layout problems.

这是VS的常见问题。通常原因是由于某种布局问题,不会重新生成.designer文件。

After deleting the .designer file right-click on the project name in the Solution Explorer and select Convert To Web Application.

删除.designer文件后,在解决方案资源管理器中右键单击项目名称,然后选择“转换为Web应用程序”。

If this is not helping either read the following article for more information.

如果这没有帮助,请阅读以下文章以获取更多信息。

#4


Something similar happens to me from time to time...I add a control and I get no intellisense...VS basically has no idea the control is on the page/designer. If I close the file (codebehind and HTML) and come back...everything is honky dory. Clunky, but it works. Worth a try. I'm using 2008 BTW.

我不时发生类似的事情...我添加了一个控件,我没有智能感知...... VS基本上不知道控件是在页面/设计器上。如果我关闭文件(代码隐藏和HTML)并回来......一切都很荣幸。笨重,但它的工作原理。值得一试。我正在使用2008 BTW。

#5


In Visual Studio menu Tools|Option and found that on the Text Editor|All Languages that the three checkboxes for Statement Completion where showing neither empty or checked but a fully coloured box - which usually means an unknown settings. So a set these all to checked (a tick) and my Intellisense started working

在Visual Studio菜单“工具”|“选项”中,发现在“文本编辑器”|“所有语言”中,“语句完成”的三个复选框既不显示空白也未选中,而是显示全彩色框 - 这通常表示未知设置。所以设置这些全部检查(勾选),我的Intellisense开始工作

for more details use following link

有关详细信息,请使用以下链接

http://forums.asp.net/t/1520617.aspx?Intellisense+not+displaying+controls+in+the+code+behind

#6


In windows 8 for some reason I have to run visual studio as administrator explicitly to get intellisense in my views.

在Windows 8中出于某种原因,我必须明确地以管理员身份运行visual studio,以便在我的视图中获得intellisense。

#1


In the past I've had problems with this because the auto-generated designer files were bad. Try deleting them and then allow VS to recreate them, this may fix the problem.

在过去,我遇到了问题,因为自动生成的设计器文件很糟糕。尝试删除它们然后允许VS重新创建它们,这可能会解决问题。

#2


Try doing a Build -> Clean Solution

尝试做一个Build - > Clean Solution

#3


This is a common problem with VS. Usually the cause is the .designer files are not re-generated due some sort of layout problems.

这是VS的常见问题。通常原因是由于某种布局问题,不会重新生成.designer文件。

After deleting the .designer file right-click on the project name in the Solution Explorer and select Convert To Web Application.

删除.designer文件后,在解决方案资源管理器中右键单击项目名称,然后选择“转换为Web应用程序”。

If this is not helping either read the following article for more information.

如果这没有帮助,请阅读以下文章以获取更多信息。

#4


Something similar happens to me from time to time...I add a control and I get no intellisense...VS basically has no idea the control is on the page/designer. If I close the file (codebehind and HTML) and come back...everything is honky dory. Clunky, but it works. Worth a try. I'm using 2008 BTW.

我不时发生类似的事情...我添加了一个控件,我没有智能感知...... VS基本上不知道控件是在页面/设计器上。如果我关闭文件(代码隐藏和HTML)并回来......一切都很荣幸。笨重,但它的工作原理。值得一试。我正在使用2008 BTW。

#5


In Visual Studio menu Tools|Option and found that on the Text Editor|All Languages that the three checkboxes for Statement Completion where showing neither empty or checked but a fully coloured box - which usually means an unknown settings. So a set these all to checked (a tick) and my Intellisense started working

在Visual Studio菜单“工具”|“选项”中,发现在“文本编辑器”|“所有语言”中,“语句完成”的三个复选框既不显示空白也未选中,而是显示全彩色框 - 这通常表示未知设置。所以设置这些全部检查(勾选),我的Intellisense开始工作

for more details use following link

有关详细信息,请使用以下链接

http://forums.asp.net/t/1520617.aspx?Intellisense+not+displaying+controls+in+the+code+behind

#6


In windows 8 for some reason I have to run visual studio as administrator explicitly to get intellisense in my views.

在Windows 8中出于某种原因,我必须明确地以管理员身份运行visual studio,以便在我的视图中获得intellisense。