Timeline for Why a private event handler does not work in ASP.NET
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 17, 2013 at 11:19 | vote | accept | S Nash | ||
Jun 14, 2013 at 13:12 | answer | added | Damien_The_Unbeliever | timeline score: 10 | |
Jun 14, 2013 at 13:02 | comment | added | S Nash | If I remove the OnClick then, it is like I have dragged 2 button to my form from the toolbox(codewise). I wanted to know why one of these works with private and otherone needs Protected. | |
Jun 14, 2013 at 12:56 | comment | added | S Nash | This situation is very simple to replicate. Anyone can setup and replicate the above scenario in 2 minutes. | |
Jun 14, 2013 at 12:55 | comment | added | Damien_The_Unbeliever |
I said remove the OnClick in the HTML, not the Handles .
|
|
Jun 14, 2013 at 12:55 | comment | added | S Nash | I just tried to add "Hanldes" after I saw the compile error. I get same compile error with or without the Handler keyword. | |
Jun 14, 2013 at 12:50 | comment | added | Damien_The_Unbeliever |
Having OnClick and Handles means you're trying to hook it up twice - once from the code behind, and once from the HTML. If you switch to Protected , you'll find that the event handler is invoked twice (as you currently have it). Remove the OnClick in the HTML
|
|
Jun 14, 2013 at 12:45 | history | edited | S Nash | CC BY-SA 3.0 |
edited body
|
Jun 14, 2013 at 12:45 | history | edited | Jens Kloster |
removed C# tag, and added vb
|
|
Jun 14, 2013 at 12:44 | history | asked | S Nash | CC BY-SA 3.0 |