asp Page events execute twice after PostBack

  • Thread starter Thread starter Jarek
  • Start date Start date
J

Jarek

Hi!

I have a page containing datagrid. When datagrid is edited there is a
calendar. When I change the date for the first time all page events are
executed twice and:
when they are executed for the first time they are executed in response to
post back as it should be, but for the second time the page is reloaded
again just like it would be called for the first time.
Please Help Me!

Jarek
 
Be sure that when the datagrid changes, it doesn't automatically
postback to the server. You may also want to use the Page.IsPostBack
property. Using this will help you only run the Page_Load code once,
instead of everytime the page gets posted back to the server.

I.e.

sub Page_Load
If Not Page.IsPostBack then
...run the code that should only be executed the first time
the page loads...
end if
end Sub


I hope this helps.

Neil
 
Back
Top