Unable to find designer generated c# code

Hello all,

I'm looking for a way to display the code that VS2005 generates when you add a new web form to a web project. Usyally in VS2003 the button "show all files" displayed all I needed. But now that button is called "Nest Related Files". Tha button just displays the .cs files you can modify but thoose files does not contain designer generated code.

I'm sure that during a Microsoft event (in the VS2005 beta time) there was a way to display that part of code, but now it seems all information about that function is removed from help.

Am I missing something obvious

Thanks for help



Answer this question

Unable to find designer generated c# code

  • mgwalm

    Thanks, Anson. That partially explains my problem but is there a solution to this

    I get blue squigglies under the variables in the code for some controls (btnAdd) I dragged onto the design surface saying "The name 'btnAdd does not exist in the current context" BUT Intellisense works when I type "." !!!

    At a breakpoint in PageLoad, I did a Watch for the _Default type (to drill down into it) and get an error msg that

    "The type '_Default' exists is both {someguidhere} and {someotherguidhere}"

    How can I resolve these so I don't get compile errors every time I press F5 (though the page works fine when shown in the Browser)


  • NewbiePhil

    Hello Antonello ,

    Are you talking of the Source view Select web page (eg. default.aspx) in the solution explorer and press Shift + F7 to toggle between Design View and Source view(System generated code)..



  • Backwards

    Thanks for the hint, but that's not what I'm looking for...

    If you look at the default.aspx.cs file you'll see something like this:

    ....

    public partial class _Default : System.Web.UI.Page {

    ....

    That means that VS designer, somewhere, hides a code file where the remaining of the partial class _Default is defined. I need to have a look at that "second half" of my class....


  • rick_

    Antonello,

    The other part of the partial class isn't actually fully generated until the page is built by the ASP.NET runtime. In a lot of cases, this happens on the server which is hosting the page. There is a skeleton of the file that is generated to offer support for design time functionality, like IntelliSense, but it is in most cases hidden from view. It probably wouldn't be that much of a help anyway, since all it contains are the member declarations and not the actual bodies of the methods. You can glimpse this if you do a preview of a refactoring that will update a reference to a symbol in the page (though that isn't something that we're likely to continue with indefinitely, since we would prefer to show the actual html/script).

    When the page is 'hit' on the server, the ASP.NET runtime will load it and generate the other part of the partial type in a temporary file. I believe that it generates those files in WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\, though someone here http://forums.asp.net/ could probably give the definitive answer.

    Hope that helps!
    Anson Horton
    C# IDE PM



  • Unable to find designer generated c# code