We help IT Professionals succeed at work.

How to get the Page Events in the drop down in Visual Studio 2008

dpicco
dpicco asked
on
Hello. I am doing examples in the Microsoft Training Kit for ASP.NET 3.5. It says I can open a code behind file for a web form in Visual Studio and the drop down on the upper left side should have "Page Events" with the drop down on the right having the actual events that occur during the page life cycle.

The only problem is that I don't have "Page Events" in my drop down. What am I doing wrong?
Thanks.
Comment
Watch Question

David RobitailleAnalyst Programmer

Commented:
make sure it  Inherits System.Web.UI.Page

Author

Commented:
Yes it does. It is a very simple code behind file:

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IMM.BusinessObjects;

namespace IMM.Admin
{
    public partial class listReferences : System.Web.UI.Page
    {
        public int totalNumberofReferences = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            Reference myReference = new Reference();
            totalNumberofReferences = myReference.TotalCount();
        }

        protected void ReferencesGrid_DataBound(object sender, EventArgs e)
        {
            if (ReferencesGrid.Rows.Count > 0)
            {
                ReferencesGrid.UseAccessibleHeader = true;
                ReferencesGrid.HeaderRow.TableSection = TableRowSection.TableHeader;              
                ReferencesGrid.FooterRow.TableSection = TableRowSection.TableFooter;
                ReferencesGrid.PagerSettings.Visible = true;
            }
        }


    }
}
Analyst Programmer
Commented:
It does not work because it`s C#
http://msdn.microsoft.com/en-us/library/6w2tb12s%28VS.80%29.aspx 
In code-behind pages that use C#, this technique will not work because the control name will not appear in the drop-down list in the last step. Use one of the other procedures instead.

Author

Commented:
Thanks!