Button causes Form_Load to fire, before Button_Click

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Button causes Form_Load to fire, before Button_Click

    Hi

    I have a form with a button on it.

    It seems that when I click the button, it causes Form_load to fire, before
    the Button_Click procedure

    Does anyone know why??

    Thanks


    Paul Aspinall Guest

  2. Similar Questions and Discussions

    1. Custom ImageButton will not Fire on button click..HELP! Thanks. :)
      Hi, it is because nothing actually calls your custom OnClick method (it is the original OnClick called at...
    2. Button-click fire before or after page_load?
      Hi - thanks for the help in this group so far. Regarding the click event of a link_button (created within a table and added to a placeholder at...
    3. fire button event programmatically
      From an aspx page (A.aspx) I open another one (B.aspx - for table lookup). When the user selects an entry in B.aspx I would like to force a...
    4. Button in WebCustomControl don't fire the onclick event, why?
      Maybe someone sees my mistake? The Button-OnClick-Event never fires... -------------------------------------------------------- The code from...
    5. FIRE
      remember google is your friend. if you put "photoshop tutorial" and anything else (i.e. "photoshop tutorial fire", or "photoshop tutorial flaming...
  3. #2

    Default Button causes Form_Load to fire, before Button_Click

    This is the firing order of events:

    Page_Init
    Page_Load
    Button_Click
    Page_PreRender
    <% %> codes on the aspx page.

    If you are trying to avoid calling the same code everytime
    the page is posted back use :

    if (!Page.IsPostBack)
    {
    // code to execute just on the first load
    }

    or

    If Not Page.IsPostBack Then
    ' code to execute just on the first load
    End If

    Hope It Helps

    Duray AKAR
    >-----Original Message-----
    >Hi
    >
    >I have a form with a button on it.
    >
    >It seems that when I click the button, it causes
    Form_load to fire, before
    >the Button_Click procedure
    >
    >Does anyone know why??
    >
    >Thanks
    >
    >
    >.
    >
    Duray AKAR Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139