vs2005 not auto adding controls to code behind

C

Charlie Bear

hi,

i'm running visual studio 2005 working on asp.net projects. Suddenly
visual studio has stopped automatically adding controls to the
designer code behind. anyone know why or how to fix it? i can add them
manually but that is annoying.
 
D

Daniel Bass

I'm not aware that it does...

Visual Studio 2003 added code to the code-behind that built the control in
the same file, where as VS2005 doesn't add it here, but to a cached file
located in the asp.net temporary folder.

Are you getting other errors to suggest this is a problem?
 
C

Chris Dunaway

I'm not aware that it does...

Visual Studio 2003 added code to the code-behind that built the control in
the same file, where as VS2005 doesn't add it here, but to a cached file
located in the asp.net temporary folder.

Are you getting other errors to suggest this is a problem?

Just a shot in the dark, but in Windows Forms programming, some
controls do not automatically generate a member in the code behind.
There is property on some controls (labels for example) called
"GenerateMember" and that must be set to true. You might try looking
for that.

Chris
 
C

Charlie Bear

thanks chris, no there isn't a generate member as far as i'm aware.

reagrding the earlier post in 2003 it put control definitions in the
code behind file when you looked at the page in design mode. in 2005
it puts them in a file called [pagename].designer.cs, when you are
looking at the page in design or html mode. this is what has stopped
working. i add controls to the page but they don't get added to the
designer page which means i have to add them by hand if i want to be
able to use them in my code behind file.
 
C

Charlie Bear

think i might have solved it. i deleted the designer file. then added
a new class file with the name of the deleted file. then i closed and
reopened the solution. then i changed one of the control names in
design mode. suddenly all the controls were added!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top