page_load is executed twice when using validation controls

G

Guest

Hi,

I have a search screen with a textbox and a button (server controls). The
page has to be submitted when the user hits the enter key in the textbox. The
code i am using to do this is..

this.txtCorpId.Attributes["onkeydown"] = "if(event.keyCode == 13){ if
(Page_ClientValidate()) document.getElementById('btnSearch').click();}";

But i find that the page_load event is executed twice when the enter key is
hit. The page works fine when submitted by clicking the button. Can anyone
help in solving this??

Thanks
Magesh
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top