why does (sender,e) => SomeAction() works on winforms and not in asp.net
问题 I have the following code: btnTest.Click += (sender,e) => SomeAction() why does this code works in WinForms and not in asp.net. In asp.net I had to do the following: btnTest.Click += new EventHandler(SomeAction); target framework in both cases is .net 4.0 回答1: Is it possible you are trying to call btnTest.Click += (sender,e) => SomeAction() from inside the Page_Load method or another event handler? In that case the parameters "sender" and "e" are already declared and can be causing a conflict