void SetEvent(ref Control control, string EventType, string EventDelegate) { //Set control.event += delegate; event = EventType and delegate = EventDelegate }
SetEvent("TextChanged", "txtBox_TextChanged"); //The function will set the event dynamically according to the parameters (txtBox.TextChanged += new EventHandler(txtBox_TextChanged);) OR SetEvent("DataBinding", "txtBox_DataBinding"); //The function will set the event dynamically according to the parameters (txtBox.DataBinding += new EventHandler(txtBox_DataBinding);)
yourTextBox.Attributes.Add("onchange", "alert(this.value);");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)