G
Guest
I can't seem to get my Custom WebControl to output a button whose click event
is associated with a particular method.
Here is the code I have right now that contains a panel and there is a
button in that panel that should be associated with a event method - but it
isn't working:
protected override void Render(HtmlTextWriter output)
{
Panel panel = new Panel();
nextButton = new Button();
nextButton.Text = "Submit";
nextButton.Click += new EventHandler(nextButtonClick);
nextButton.Visible = true;
panel.Controls.Add(nextButton);
Controls.Add(panel);
panel.RenderControl(output);
}
I should add that this Custom WebControl may eventually contain multiple
Panels - is this the proper inheritance for this Custom WebControl:
public class SurveyWebControl : System.Web.UI.WebControls.WebControl,
System.Web.UI.INamingContainer
Thanks,
Novice
is associated with a particular method.
Here is the code I have right now that contains a panel and there is a
button in that panel that should be associated with a event method - but it
isn't working:
protected override void Render(HtmlTextWriter output)
{
Panel panel = new Panel();
nextButton = new Button();
nextButton.Text = "Submit";
nextButton.Click += new EventHandler(nextButtonClick);
nextButton.Visible = true;
panel.Controls.Add(nextButton);
Controls.Add(panel);
panel.RenderControl(output);
}
I should add that this Custom WebControl may eventually contain multiple
Panels - is this the proper inheritance for this Custom WebControl:
public class SurveyWebControl : System.Web.UI.WebControls.WebControl,
System.Web.UI.INamingContainer
Thanks,
Novice