In asp event occurs once for textbox.textchanged AND button.button

G

Guest

I have a textbox and a button on my asp.net form. I have some Smtp code in my
button click procedure. When the user hits the return for the textbox the
button procedure runs. When the button is clicked the button procedure also
runs. This fine so I get the Smtp code to run either way. The problem is that
the user sometimes hits return AND clicks the "submit" button so the Smtp
code gets executed twice. Should I use Application state and a boolean to
make sure that the Smtp code only runs once?

I tried the various events and assigning them to each of the the textbox
changed and button click, but I could find the correct combination. Even if
no event is assigned to the textchanged or button click the code Smtp code
runs when the two events occur so I don't know the easy way around this. Help!

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top