Is there a difference between these 2 ways of removing an event handler?

Viewed 103

Is there a difference here?

Button1.Click -= new EventHandler(Button1_Click);

and

Button1.Click -= Button1_Click;

The second method doesn't seem to work for me but I've seen it used when Google-ing 'how to remove an event handler'. Edit: Actually neither are working for me, even so should either work interchangeably?

Update:

The reason these didn't appear to work for me is because I had AutoPostBack=true on my controls. I wasn't setting breakpoints to see if the events were called, I just watched the browser to see if it refreshed (meaning a post-back).

2 Answers
Related