I'm not a fan of the Designer, I prefer to code straight to the ASPX page. However, since a reformat (and leading up to the reformat), the designer.cs
files have not been updating correctly when manually coding to the .aspx file. This means my code behinds are not recognizing new controls and throwing compiler errors.
How can this be prevented or the designer.cs file to be forced to recompile after manually coding the aspx file? I know I can type the controls manually into the designer file, but this is time consuming and well, obnoxious when creating larger aspx pages.
Edit
WebDude's answer used to work, but switching to design view no longer solves the problem with any degree of consistency. Any more ideas?
designer. cs file and then right-click on the settings. settings file and select "Run custom tool". That will regenerate the settings.
aspx. designer. cs file contains all the definition of the controls that are being used by the page. It's just segregation of the code using partial class feature.
Simple solution,
Delete the designer.cs page, right click on the aspx/ascx page and choose Convert to Web Application.
and you are all set!!!
Bhavesh
This happened to me when I installed the sp1 in visual studio 2008. The way i got my code behind to recognise my controls was by viewing the aspx page in designer mode, then changing back to code view.
This seemed to give visual studio the slap it needed to start automatically populating my designers.
I realise your problem is in Vis 2005, but this could help you
Good Luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With