Results 1 to 4 of 4

Thread: [02/03] Event handler problem

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    [02/03] Event handler problem

    Hello everybody,

    Sometimes it happens that click event of a button or load event of form doesn't fire. I then check the InitializeComponent() method and find that the event handler is not registered and I register it and it starts working however the event handler was previously registered and was working fine.

    Any idea why is this happens that event handler got unregistered and how to resolve it?

    Thanks.

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724

    Re: [02/03] Event handler problem

    It's a known issue with the Visual Studio UI designer. If you absolutely have to use the designer, just keep a backup of the InitializeComponent method somewhere. Alternatively, avoid using the designer and tap out your HTML.

  3. #3

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: [02/03] Event handler problem

    Basically it happens with me when after making some changes, I compile my project and upload the dll on the server. Then I notice or someone reports that the button is not working and the data on page not is not loaded. I then check the InitializeComponent() method and finds this. Did Microsoft not provide any solution to this?

    Thanks.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [02/03] Event handler problem

    Yeah, they called it VS 2005.

    When I was working in 1.1, I found that I had to create and edit my layout in the HTML view. I'd then save the page. Then I'd go to the design view. Save the page. Then go to the codebehind. It then worked.

    Ideally though, you should build and test run first before uploading.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width