asp Page events execute twice after PostBack

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
 
N

nfedin

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top