Forum Moderators: open
Here is the code to create the button and add it to the PlaceHolder:
Button btnSubmitForPO_Final = new Button();btnSubmitForPO_Final.Text = "View Purchase Order";
btnSubmitForPO_Final.CommandArgument = "It Worked";btnSubmitForPO_Final.Command += new CommandEventHandler(this.btnSubmitForPO_Final_Command);
phOffhireInfo.Controls.Add(btnSubmitForPO_Final);
I then set up a method to catch the ButtonClicks via the CommandArgument
private void btnSubmitForPO_Final_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
{
Response.Write(e.CommandArgument.ToString());
}
My problem is this. If I write this code on it's own WebForm and test it, it works perfectly fine. However, it is not working within the page that I need it for (which includes a great deal of other code). I have no idea how to test why it isn't working since there really isn't a very good place for me to put a breakpoint (if i put it on the first part of the code it runs through...if i put it on the second part, it never gets there). If i delete the btnSubmitForPO_Final_Command method to catch the Event, compiling throws an error saying it can't find the method, so I know that it's looking for it when it compiles...for whatever reason it doesn't fire on run time
How do I figure out why the CommandEventHandler is not triggering ... I can't think of a proper test case or alternate test to figure out my problem
-Mike