Oct 09, 2008, 7:51 AM
[CLOSED] Adding Custom Events
Hiya,
I am wondering what the best way to add custom events to controls.
An example is the "mousdown" and "mouseup" events on a button. I can do this by writing javascript code such as
But my main question is, which way would you recommend we achieve the required results?
thanks,
Conor
I am wondering what the best way to add custom events to controls.
An example is the "mousdown" and "mouseup" events on a button. I can do this by writing javascript code such as
protected void Page_Load(object sender, EventArgs e)
{
string fn = "Ext.get('mybutton').on('mousedown',function(){alert('mousedown')});";
this.ScriptManager1.RegisterOnReadyScript(fn);
}
What I was trying to use initially was manipulate the button control directly through code snippets (which I could not get to work) such as
this.mybutton.AddEvents("mousedown");
this.mybutton.AddListener("mousedown", fn);
Firstly, is it possible to achieve the above through code on the server side, or through the Listener "Add" tag in the control itself?But my main question is, which way would you recommend we achieve the required results?
thanks,
Conor