This overrides the OnClick and alters its Text property to show HELLO
when clicked. This worked perfectly and the code is shown below.
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace CustomControls
{
public class mybutton : System.Web.UI.WebControls.Button
{
public mybutton( )
{
this.Text = "Push Here";
}
protected override void OnClick(EventArgs e)
{
base.OnClick(e);
this.Text = "Hello";
}
}
}
I added the mybutton to the ToolBox and then dragged it on a clean c#
ASP.NET web form. It works when clicked with the mouse but if I try to
invoke it using :
this.Mybutton1_Click(sender,e);
it just ignores my override code, and the HELLO is not shown. WHY ???
What should I be doing to trigger the mybutton OnClick event (of the
instance MyButton1) programatically ?
Thanks
David Vella
Malta
David
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
So my question is, how can one trigger an event of any custom web
control programatically ?
Regards
David Vella
walter easy
Regards
David Vella