P
phoenix
I have a form with a Submit button and a few other HTML controls but I'll
leave them out of this for simplicity. When Submit is clicked, the server
looks in the event handler declaration code for the matching event. It
doesn't find it even though it's there and moves on to Page_Load. The
button declaration and event handler code was generated by the IDE. I even
tried re-adding the button and then tried creating a brand new button with a
different ID and adding that to the form instead. Neither tactics worked.
I *know* it's not hitting the event. I have breakpoints all over in my
code. It looks in InitializeComponent and then goes directly to Page_Load.
The SubmitButton:
protected System.Web.UI.WebControls.Button SubmitButton;
EventHandler List:
private void InitializeComponent()
{
this.SubmitButton.Click += new
System.EventHandler(this.SubmitButton_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
My SubmitButton_Click handler code:
private void SubmitButton_Click(object sender, System.EventArgs e)
{
int i = 0;
}
leave them out of this for simplicity. When Submit is clicked, the server
looks in the event handler declaration code for the matching event. It
doesn't find it even though it's there and moves on to Page_Load. The
button declaration and event handler code was generated by the IDE. I even
tried re-adding the button and then tried creating a brand new button with a
different ID and adding that to the form instead. Neither tactics worked.
I *know* it's not hitting the event. I have breakpoints all over in my
code. It looks in InitializeComponent and then goes directly to Page_Load.
The SubmitButton:
protected System.Web.UI.WebControls.Button SubmitButton;
EventHandler List:
private void InitializeComponent()
{
this.SubmitButton.Click += new
System.EventHandler(this.SubmitButton_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
My SubmitButton_Click handler code:
private void SubmitButton_Click(object sender, System.EventArgs e)
{
int i = 0;
}