[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.
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.
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.
Re: [02/03] Event handler problem
Yeah, they called it VS 2005. :D
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.