Page Class Events

  • Thread starter Thread starter Scott M.
  • Start date Start date
S

Scott M.

How can I get Visual Studio 2008 Pro. to show me a list of the Page class's
events (as I can get in VB .NET)?

In the page designer, with the DOCUMENT selected in the Properties Window,
there is no lighning bolt icon to switch over to the events for the selected
object (the bolt is there for any other server objects I select).

In code view, if I drop down the top-left dropdown, I see only my instance
of the page listed, but in the top-right dropdown, it does not list the
events available, only those methods that I have already set up.

What am I missing?
 
I have not yet upgraded from 2005 to 2008, but I believe that the way Visual
Studio does the dropdowns in codebehind is that VB.NET gives you the ability
to select events from the right dropdown for the object selected in the left
dropdown, but C# does not give you this option. Based on what you are
saying, it sounds like you were forced to switch from VB.NET to C# (I was
also at my new job). I have found that the best workaround for Page events
is to type override and then select the event method (such as OnInit) from
the list shown. If you press enter when the desired event method is
selected, it will place the signature in your codebehind for you. It's not
what we want, but C# apparently doesn't like convenience for events. Good
Luck!
 
Back
Top