NazoUK
asked on
Visual Studio 2008 Error List showing spurious errors
My Visual Studio (developing asp.net applications) error list constantly shows hundreds of errors, even though there are actually none within the site. The errors are all of exactly the same type: 'The name xxx does not exist in the current context'. xxx refers to a server side control declaratively defined. It seems like VS is checking the code behind files but isn't checking the declarative files when doing its checks.
The app builds without issue.
It's not killer, but it is annoying and makes it difficult to find genuine errors. I've applied all service packs and updates. Anyone encountered this and know how to fix it?
The app builds without issue.
It's not killer, but it is annoying and makes it difficult to find genuine errors. I've applied all service packs and updates. Anyone encountered this and know how to fix it?
In your code behind you must create the member as well. When you drag/drop a control on you Layout View VS will generate this for you; otherwise you have to do it yourself. It isn't that hard:
public class MyWebPage : System.Web.UI.Page
{
protected System.Web.UI.WebControls. Panel pnlDescription;
// ...
public class MyWebPage : System.Web.UI.Page
{
protected System.Web.UI.WebControls.
// ...
ASKER
Hi,
Thanks for the response but I've checked my project and there aren't any backup files in there.
Also, I've never heard of having to declare server controls in the code-behind as well and never seen it done in any of the books, blogs, articles etc I've read so I'm not convinced about that. Also I tested in VS layout view and it didn't automatically add anything.
Thanks for the response but I've checked my project and there aren't any backup files in there.
Also, I've never heard of having to declare server controls in the code-behind as well and never seen it done in any of the books, blogs, articles etc I've read so I'm not convinced about that. Also I tested in VS layout view and it didn't automatically add anything.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://dotnetfish.blogspot.com/2007/08/name-xxx-does-not-exst-in-current.html