C
chris
Hi All,
I have, in my web app, what I think must be a pretty simple problem.
I create several textboxes dynamically depending on the value from a
dropdown that causes a post back. After the textboxes are created I create a
button this way:
Button btnGo = new Button();
btnGo.Text = "Go >>";
btnGo.ID = "btnGo";
btnGo.Click += new System.EventHandler(this.btnGo_Click);
frm.Controls.Add(btnGo);
I also create the method that handles the button OnClick event (I just do a
redirect here, but nothing inside the method works)
private void btnGo_Click(object sender, System.EventArgs e)
{
Response.Redirect("http://www.microsoft.com");
}
When I click on the generated Button, I only get what looks like a post back.
What do I need to do to get the btnGo_Click method to execute OnClick? Am I
missing something obvious?
Help is much appreciated. Thank you!
I have, in my web app, what I think must be a pretty simple problem.
I create several textboxes dynamically depending on the value from a
dropdown that causes a post back. After the textboxes are created I create a
button this way:
Button btnGo = new Button();
btnGo.Text = "Go >>";
btnGo.ID = "btnGo";
btnGo.Click += new System.EventHandler(this.btnGo_Click);
frm.Controls.Add(btnGo);
I also create the method that handles the button OnClick event (I just do a
redirect here, but nothing inside the method works)
private void btnGo_Click(object sender, System.EventArgs e)
{
Response.Redirect("http://www.microsoft.com");
}
When I click on the generated Button, I only get what looks like a post back.
What do I need to do to get the btnGo_Click method to execute OnClick? Am I
missing something obvious?
Help is much appreciated. Thank you!