Re: Sequence of events on a web form

Discussion in 'ASP .Net' started by Craig Deelsnyder, Jul 28, 2003.

  1. Page_Load is run on every page load or postback. Remember the web is
    stateless, so ASP.NET, when a request comes in, it creates the corresponding
    Page class/object for whatever page was requested. It then runs the
    Page_Load event and continues from there.

    If there's some processing you want done only once (when the page is first
    loaded from the user's perspective), add a check for IsPostBack in the
    Page_Load event....

    If Not IsPostBack then
    '//do some initial page loading, maybe setup your table, bind datasources,
    etc.
    End If

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET


    "John Black" <> wrote in message
    news:%...
    > I am a little confused about the sequence of events on a webform. I am

    going
    > through the MCAD/MCSE certification book for .NET programming from
    > Microsoft. Chapter 5 is the database chapter. I am trying to bind a

    datagrid
    > to the datasource after updating the dataset. I just investigated the best
    > place to put the dataset.update command and have discovered that my
    > Page_Load event gets fired immediately after clicking the "AddRow" button

    I
    > have on my web form. Does anyone else have the same problem?
    >
    > Paul
    >
    >
     
    Craig Deelsnyder, Jul 28, 2003
    #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. John Spiegel

    Sequence of events

    John Spiegel, Jan 3, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,224
    John Spiegel
    Jan 3, 2005
  2. Replies:
    2
    Views:
    494
  3. John Dalberg

    Need to trace sequence of server events

    John Dalberg, Oct 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    327
    Mark Fitzpatrick
    Oct 5, 2006
  4. stef mientki
    Replies:
    13
    Views:
    644
    stef mientki
    Oct 20, 2007
  5. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    373
    Chris
    Aug 30, 2005
Loading...

Share This Page