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
>
>
|