Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2005 Designer not adding controls to the aspx.Designer.cs

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?

like image 966
ForCripeSake Avatar asked Oct 09 '08 15:10

ForCripeSake


People also ask

How do I create designer CS settings?

designer. cs file and then right-click on the settings. settings file and select "Run custom tool". That will regenerate the settings.

What is ASPX designer CS file?

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.


2 Answers

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

like image 189
Bhavesh Avatar answered Sep 29 '22 01:09

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!

like image 28
WebDude Avatar answered Sep 29 '22 01:09

WebDude