page_load is executed twice when using validation controls

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFnZXNo?=, Aug 25, 2004.

  1. 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
    =?Utf-8?B?TWFnZXNo?=, Aug 25, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alberto

    Event executed twice

    Alberto, Jan 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    356
    Steve C. Orr [MVP, MCSD]
    Jan 12, 2004
  2. bminder
    Replies:
    1
    Views:
    2,163
    nfedin
    Feb 23, 2004
  3. Richard Lionheart

    Page_Load(...) not executed in MainWebForm.aspx

    Richard Lionheart, Oct 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    557
    Richard Lionheart
    Oct 15, 2005
  4. Replies:
    3
    Views:
    584
    Terry Burns
    Feb 3, 2006
  5. Jeff

    Page_Load not executed

    Jeff, May 4, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    471
    Cowboy \(Gregory A. Beamer\)
    May 4, 2009
Loading...

Share This Page