I'm sorry you are having these problems. First off (and this is advice to others) -- always make a backup! It just makes good sense whenever you run a program which will modify the source code of your project.
In the Web Site Project (WSP, the default web project in VS05 RTM), all control variables are generated in a hidden class which exists in memory. This is possible since in VS05 both C# and VB supports partial classes, and allows us to separate auto-generated code such as control variables from user code -- this is a good thing in general.
"Show All Files" is grayed out since it is not needed in a WSP -- all files are already shown in the Solution Explorer. Since the hidden class is not a file, it is not shown.
I do admit it would be nice to see these hidden variables when you are trying to find a troublesome bug or you really want to know what is happening. Unfortunately, there is not an easy way to do it. However, you can trigger a run-time error which will show the temp file created from the hidden class which will allow you to see what is generated.
- Open the code-behind file containing the partial class that you want to see the control variables created for. Let's assume it is Foo.aspx.cs and you have added a Label called "Label1" in Foo.aspx.
- In the Page_Load(), add some code that will not compile, e.g.
Label2.Text = "foo"; // this assumes that Label2 does not exist in Foo.aspx
- The trick now is to run this in IE without validating the page first. By default, when you press F5, VS05 will compile the page to validate it, and if it compiles fine it will run the page in IE. We want to skip the validation step. So instead, just go to the Solution Explorer and bring up the context menu for Foo.aspx and say "View in browser".
- This will run the page in IE. You will get an error like
Compilation Error Message CS0103: The name 'Label2' does not exist in this context.
- Under this error, you should also see the command "Show Complete Compilation Source"
- Select this command and you will see the temp file generated from the hidden class. You will find a line like this:
protected global::System.Web.UI.WebControls.Label Label1;
HTH!