Link to home
Start Free TrialLog in
Avatar of Jenslove
Jenslove

asked on

Does not contain a definition for an object, but the object is there!

I am running into a problem I can't seem to solve.

I am using Visual Studio 2005 and have a fairly large webform solution in development. On one of my webforms I have added objects, a grid view and sqldatasource if it matters. when I am coding the tool tips helper sees the objects when I am typing, showing me all their methods/properties/etc;; but when I compile the code I get "AdminDivision does not contain a definition for 'sdsDDLApprovers'". However, when I answer yes to continue at compilation to continue on and view the web solution the page works fine, I can even use the object that are throwing the error when compiling in VS 2005!! AdminDivision is the webform and sdsDDLApproveres is an SQLDataSource placed on the webform. I have other gridviews and sqldatasources on the webform, clearly named differently, and which don't throw errors when compiling. and I am not missing a method or anything like that, I believe, its the actual object as stated in my quote above that is throwing the error.

I have looked to see if there is some way to get to the generated code, the 'hidden' generated code in VS 2003 that handled all the object creations/instantiations, but I can't seem to get to it in VS 2005.

Soooo, What is my problem? And IS there hidden code that you can edit in VS 2005 that I can't find?

I will be glad to post code, files, pics, etc. but it would seem to me a more general problem concerning VS 2005. I just don't get how it can be throwing an error butr still work when I go past the errors!
Avatar of DarkoLord
DarkoLord
Flag of Slovenia image

> However, when I answer yes to continue at compilation to continue on

Are you sure the question is if you want to continue? I think it asks you if you want to run the last successful build.
Avatar of Jenslove
Jenslove

ASKER

Ah, you are correct; it is the last successful build.

But I can still SEE the objects on the page, I have checked spelling several times, and the object listbox (not sure what its offical name is) that helps you complete object names see the gridview and datasource.

I am just stumped.

I took all the elements and put them on a new, test page and the same exact code works fine. when I put them back onto the page I need them on it doesn't work.

I will post anything you ask for. I'm just not sure what more would help you determine what I'm doing wrong. :\
Also, if I add a simple button to the webform it can't compile because the compiler can't 'see' the 'Button1' object.

Its like the webform has reached a limit and nothing more can be added to it; or the part that connects objects across aspx and aspx.cs is corrupt or bad. I know in VS 2003 I could go into the hidden region and alter/change things, but in VS 2005 there is no such place...or am I missing something?

And thanks for the reply, sorry I was so late in replying myself.

I appreciate any and all help.
ASKER CERTIFIED SOLUTION
Avatar of DarkoLord
DarkoLord
Flag of Slovenia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I resolved the problem, though I still don't know WHAT the problem was.

I took the pertinent code and placed it into a new webform and it worked fine; so after this test I took all the code from the aspx and aspx.cs and made a new webform. This fixed the problem so I am moving on.

I have acknowledge you as the solution provider as you were the only one kind enough to answer. I appreciate your time!