|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Events not fired for Dynamically Created Controls in VS2005 ASP.NET 2.0release. When clicking the button, it posted back, but the "addQL_Click" method is not called. Any suggestion would be very much appreciated. public class MyEditor: EditorPart, INamingContainer { protected override void CreateChildControls() { Controls.Clear(); addButton("Add", "Add", new EventHandler(this.addQL_Click), this.Controls); ChildControlsCreated = true; } private void addButton(string buttonID, string buttonText, EventHandler myHandler, System.Web.UI.ControlCollection myControls) { Button _actionButton = new Button(); _actionButton.ID = buttonID; _actionButton.Text = buttonText; if (myHandler != null) _actionButton.Click += myHandler; myControls.Add(_actionButton); } private void addQL_Click(object sender, EventArgs e) { } } Hi Richard,
I got this problem too. Any solutions? Thanks Show quoteHide quote "Richard Huang" wrote: > Following code worked for VS.NET 2005 Beta 2, but not for the final > release. When clicking the button, it posted back, but the > "addQL_Click" method is not called. Any suggestion would be very much > appreciated. > > public class MyEditor: EditorPart, INamingContainer > { > protected override void CreateChildControls() > { > Controls.Clear(); > addButton("Add", "Add", new EventHandler(this.addQL_Click), > this.Controls); > ChildControlsCreated = true; > } > private void addButton(string buttonID, string buttonText, > EventHandler > myHandler, System.Web.UI.ControlCollection myControls) > { > Button _actionButton = new Button(); > _actionButton.ID = buttonID; > _actionButton.Text = buttonText; > if (myHandler != null) > _actionButton.Click += myHandler; > myControls.Add(_actionButton); > } > > private void addQL_Click(object sender, EventArgs e) > { > } > } > >
2.0 menu control and color
Dropdownlist: SelectedValue which is invalid Understanding query strings VS2005 Designer does NOT display asp:panels!! Why? contenteditable Coding issue View State problem when multiple user work on the same page onload called only once Custom Buttons preserve password field over steps in wizard |
|||||||||||||||||||||||