Bill Martin
Bill Martin

Reputation: 4943

Intellisense not showing up for new controls in code behind

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.

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" %> ");

Any ideas?

Upvotes: 4

Views: 9782

Answers (6)

Sumit Jambhale
Sumit Jambhale

Reputation: 635

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

for more details use following link

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

Upvotes: 1

MondayPaper
MondayPaper

Reputation: 1579

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

Upvotes: 0

J Pollack
J Pollack

Reputation: 2858

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

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

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

Upvotes: 2

Sanjay
Sanjay

Reputation:

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.

Upvotes: 2

Jason
Jason

Reputation: 89214

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.

Upvotes: 5

GlitterMonkey
GlitterMonkey

Reputation: 95

Try doing a Build -> Clean Solution

Upvotes: 2

Related Questions