A
Arthur Puszynski
Hello,
I cannot figure out why this doesnt work. This is almost exactly the same as
the samples I've seen but it doesnt work for me.
I am making a composite control with a button that has a click event but the
event never fires.
Here's my code:
public class WebCustomControl1 : System.Web.UI.WebControls.WebControl
{
protected override void CreateChildControls()
{
Button sButton = new Button();
sButton.Click +=new EventHandler(sButton_Click);
Controls.Add(sButton);
base.CreateChildControls ();
}
protected override void Render(HtmlTextWriter output)
{
Controls[0].RenderControl(output);
}
private void sButton_Click(object sender, EventArgs e)
{
((Button)Controls[0]).Text = "Clicked";
}
}
Any ides?
Thank you,
Art
I cannot figure out why this doesnt work. This is almost exactly the same as
the samples I've seen but it doesnt work for me.
I am making a composite control with a button that has a click event but the
event never fires.
Here's my code:
public class WebCustomControl1 : System.Web.UI.WebControls.WebControl
{
protected override void CreateChildControls()
{
Button sButton = new Button();
sButton.Click +=new EventHandler(sButton_Click);
Controls.Add(sButton);
base.CreateChildControls ();
}
protected override void Render(HtmlTextWriter output)
{
Controls[0].RenderControl(output);
}
private void sButton_Click(object sender, EventArgs e)
{
((Button)Controls[0]).Text = "Clicked";
}
}
Any ides?
Thank you,
Art