hey im having problems with a delegate to an event
1 Button btnOK = new Button();
2 Label ll = new Label();
3
4 btnOK.Text += "OK";
5 btnOK.Enabled = true;
7 btnOK.Click += delegate(object send,EventArgs arg) {throw new Exception(); };I need to use this anonymously like this where i can type the code directly in, and this works in winforms, but in webformes the delegate isent activated when i push the button.
and i have no idea why... please help ps. So to clarify i have to use it anonymously because i need to use some local fields (instead off the throw exception), so i would NOT be able to do the standard way!
btnOK.Click += < ...
Go to the complete details ...