none
Course 2310D - Exercise 2 Creating Event Procedures Page 4-66 RRS feed

  • Question

  • Hi all, I'm currently teaching myself Visual Studio 2010, have purchased the course books (and the course, but they can't get enough people to run it locally so I'm doing it this way for now)

    Seeing that I always do things the hard way, I've purchased VS 2010 Professional and doing the VS 2008 course.....

    Anyway I have a simple question that been bugging me.

    the course says :

    Task 4: Create an event procedure for the Page_LoadComplete Event.

    The answer sheet says to:

    Task 4: Create an event procedure for the Page_LoadComplete event.

    1. Create an event procedure for the Page_LoadComplete event.
    • In the InsertCustomer.aspx.vb code window, in the Object list, click (Page Events), and then in the Declarations list, click LoadComplete.

    In VS 2010 I can't find the Object List - where would I find this?

    I know I can type it in manually I just want to use the development editor to do the task as intended.

    Thanks,

    Kevin


    First Nations Tech Inst
    Tuesday, July 20, 2010 3:50 PM

Answers

All replies

  • Hi,
     
    This may be of some help,
     
     

    -- Mike Burr
    Tuesday, July 20, 2010 4:15 PM
  • Yup got there before which results in:

    NoteNote

    You cannot select the page in Design view, so you cannot create a page-level event using this procedure. Use the previous procedure instead.

    So again where do I click in the UI to access this? There is no "previous procedure" in the help that I can see.

    Thanks!

     


    First Nations Tech Inst
    Tuesday, July 20, 2010 5:05 PM
  • It doesn't appear that you can select the page to create event handlers
    through the designer, but you can still create the handler
    programmatically. I did this with the following,
       public TestWebForm()
      {
        this.LoadComplete += new EventHandler(TestWebForm_LoadComplete);
      }
       void TestWebForm_LoadComplete(object sender, EventArgs e)
      {
         throw new NotImplementedException();
      }
     
    It would appear that the Page control is the only server control that
    you cannot add event handlers with the designer. If you add a button,
    open the events part of the properties, and double click an event such
    as Load, then it will create a handler.
     

    -- Mike Burr
    Tuesday, July 20, 2010 5:45 PM
  • Thanks that's what I figured as well, just posted in case I missed a button!

     


    First Nations Tech Inst
    Tuesday, July 20, 2010 6:04 PM