c# - Add event handler to button in from codebehind in asp.net application -
i want add together event handler dynamically created button, when button appears , click on that, nil happen juste don't understand, code:
protected void page_load(object sender, eventargs e) { button b = new button(); b.click += new eventhandler(myeventhandler); b.text = "click"; panel1.controls.add(b); } protected void myeventhandler(object sender, eventargs e) { string test="hello world"; }
the breakpoint @ "string test......" never raised.
thanks in advance help.
c# asp.net event-handling
No comments:
Post a Comment