There must be a way to change this.  Finally on my way to developing my first full-fledged .Net 2.0 app as a side project, and I notice that the code-behind page that Visual Studio 2005 gives you is missing a few things, most notably the control definitions and Page_Init.  Well, problem easily solved... right-click the class name for the page, click "Find All References", and lo and behold, I get a list - one of which looks like this:

public partial class signup : System.Web.SessionState.IRequiresSessionState {
Well, that looks like what I'm looking for, so I double-clicked the result... and got this:



Are they serious?  That's the default for this sort of thing?  Hmmm... can't be just me looking for this, so I searched Google Groups... nothing.  Searched the web... one thing in Russian I think... not much help.  So (*groan*) I dove into the options... to no avail.

This is just silly.  I found this blog entry that discusses how ASP.Net 2.0 automagically wires up Page_* methods to events if AutoEventWireup is set to true in the @Page directive - automagic is fine, but there really should be a way you can take a look at and even control the code that gets generated.  Maybe it's just the talk by Charles Petzold that I attended last year, but not having control over something like variable declarations and event hookup, even if I wouldn't change it 99% of the time is just troubling.  If I've learned anything being a Microsoft developer, it's that if there's one circumstance that will cause their automagic, drag-and-drop demos to be not so magical - that circumstance will come up time and time and time again (see also: anything but a TemplateColumn on a DataGrid).

I know I'm late to the party - but I hadn't expected to hit this sort of thing the very first day I decided to wire up a control's events... lame.

[Update: I've opened a bug on the MSDN feedback site for this - give it a vote if you have a spare second or 3.]
Creative Commons License This work is licensed under a Creative Commons License.