views:

153

answers:

1

In .net 1.1 I seem to remember I had to declare web controls that I had put on my aspx page also in the code behind in order to access them programatically. Since working in VS 2008 I haven't had to do that - even when working with .net 2 projects.

But I just imported a 1.1 project and converted it in 2008 and added a textbox with an id of results to the aspx page and I can't programatically access that from the code behind - I'm getting a compile error.

Is this a setting in VS or on the top of the aspx page?

+1  A: 

Just open the page in the designer, give it a moment to "settle" (maybe no longer necessary, but we used to need to do this with the old designer code), then "touch" the page (change something, then change it back), then save the page, still in the designer. See if that works.

It may be necessary to add the text box in the designer.

Your VS2008 project may be a web site "project", in which case, the controls are not emitted into code by the designer. The VS2003 project is in the style that requires the controls to be in code as well, so use the designer, which was assumed in VS2003.

John Saunders