Adding Event Handler

Discussion in 'ASP .Net Web Services' started by Trecius, Apr 2, 2009.

  1. Trecius

    Trecius Guest

    Hello, Newsgroupians:

    I am starting to learn ASP .NET, and I'm using Visual Studio 2005. I am
    following a book as my guide. However, I'm having some problems
    automatically creating methods for my event handlers.

    To start, it tells me to create a new "Web Form" by going to File --> New
    --> File... --> Web Form. This creates a file for me called Default1.aspx.
    In the design mode, I drag a button control onto the whiteboard, or document,
    and try to proceed to add the button's click event handler.

    I click the button; I view the properties window. In the properties
    windows, I click the events button, which is the lightning bolt. I try to
    double-click the "Click" event, but it just switches me to the "source view."
    So I go back to the properties window and -- this time -- I type in the name
    of the handler for the click event. This time, Visual Studio adds the
    attribute "OnClick" to the definition of my button; however, it does not
    populate the <script> section with the method. Any ideas why it doesn't work?

    I've also tried selecting the button from the drop-down menus at the top of
    the source view and then selecting the Click button. I get no results; it
    doesn't add the method.

    Thank you.


    Trecius
     
    Trecius, Apr 2, 2009
    #1
    1. Advertisements

  2. Trecius

    JM Guest

    > I click the button; I view the properties window. In the properties
    > windows, I click the events button, which is the lightning bolt. I try to
    > double-click the "Click" event, but it just switches me to the "source
    > view."


    Double click on the button instead.

    John
     
    JM, Apr 3, 2009
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QW5kcmV3IFdpZWQ=?=

    Adding event handler for dynamically created controls

    =?Utf-8?B?QW5kcmV3IFdpZWQ=?=, Apr 19, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,634
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Apr 25, 2004
  2. Laurent Bugnion
    Replies:
    1
    Views:
    10,479
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jan 21, 2006
  3. Nathan Sokalski
    Replies:
    8
    Views:
    4,859
    Raymond
    Mar 1, 2006
  4. Replies:
    1
    Views:
    952
    Damien
    Feb 22, 2007
  5. Nathan Sokalski
    Replies:
    1
    Views:
    413
    Mark Rae [MVP]
    Nov 1, 2007
  6. news.rz.uni-karlsruhe.de

    Adding ajax/som event handler programmatically

    news.rz.uni-karlsruhe.de, Jan 27, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    605
    Axel Gallus
    Jan 27, 2008
  7. matt del vecchio

    Adding control & Event Handler at run-time

    matt del vecchio, Jan 23, 2004, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    318
    matt del vecchio
    Jan 23, 2004
  8. John Kilgo

    Adding Event Handler to Dynamically added Controls

    John Kilgo, Apr 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    411
    John Kilgo
    Apr 26, 2005
Loading...