C
COHENMARVIN
I created asp.net pages that contained several controls, including
buttons. I would double click on the button, and this would take me
to the 'code-behind' page, and create the shell of a routine to handle
that button click. What I found later though, was that this routine
was being executed twice. So I looked into it, and I found that the
button had a 'onclick' attribute which was pointing to the routine,
but also, the routine had a 'handles' clause, that pointed to the
button. So the routine was being executed twice, and I had to get rid
of the 'onclick' attribute.
The mystery is, how did the 'onclick' attribute get into the button.
A few days later, I looked at a page that had always worked, and this
time a gridview associated routine was being executed twice, and
causing a bug. The cause was similar - there was a routine with a
handles clause that pointed to the gridview, but the gridview also had
a 'onselected' type attribute that pointed to the routine.
The mystery is, how did this 'onselected' attribute get into the
gridview. I certainly didn't put it there on purpose.
So is there some bug in asp.net where if you click on some control
accidentally, you prefill it with an 'onclick' event?
Thanks,
Marvin
buttons. I would double click on the button, and this would take me
to the 'code-behind' page, and create the shell of a routine to handle
that button click. What I found later though, was that this routine
was being executed twice. So I looked into it, and I found that the
button had a 'onclick' attribute which was pointing to the routine,
but also, the routine had a 'handles' clause, that pointed to the
button. So the routine was being executed twice, and I had to get rid
of the 'onclick' attribute.
The mystery is, how did the 'onclick' attribute get into the button.
A few days later, I looked at a page that had always worked, and this
time a gridview associated routine was being executed twice, and
causing a bug. The cause was similar - there was a routine with a
handles clause that pointed to the gridview, but the gridview also had
a 'onselected' type attribute that pointed to the routine.
The mystery is, how did this 'onselected' attribute get into the
gridview. I certainly didn't put it there on purpose.
So is there some bug in asp.net where if you click on some control
accidentally, you prefill it with an 'onclick' event?
Thanks,
Marvin