How does client know when postback finished?

G

Guest

A postback I'm doing takes ages to get the data which it then uses to
populate a table.

What I want to know is:

How can I get the client side to fire a 'resize' event when the postback
thing has finished?
 
M

Martin Eyles

adolf garlic said:
How can I get the client side to fire a 'resize' event when the postback
thing has finished?

Hi,

As far as the client is concerned the postback is an entirely new page.
Therefore, the client need to look for the page load being complete, and the
run your 'resize' script. Perhaps something like:-

<body onLoad="javascript:resize();">

HTH,
Martin
 
T

Teemu Keiski

You could wire handler onto body's onload which is raised when document is
completely loaded at client.
 
G

Guest

I'm already calling the "resize" function from the form load event (which in
turn is called by the body load event.)

It doesn't work.
 
G

Guest

Surely this will just trigger the same behaviour (as shown in other replies)
as if i were just calling page load?

If not then what do you mean by wiring a handler?
Alternatively, is there a way of calling client script functions from the
server side (this would be the best solution)
 
P

Patrice

It looks like there is a bit of confusion between server and client side.
You don't "call" a client side script from server side. Server side you
create an HTML page. You can inject in this page some client side script
that will be called client side once this part is loaded client side or on
whatever event is available client side.

IMO Martin made a good suggestion ie. using the onload event on the body
tag. If reporting JS errors is disabled note also the event may work but get
unoticed because of an error in your javascript code. You could start by
just displaying an alert box when the document is loaded to see if it fires
correclty before plugin here more complex scripts. Make sure also your
browser is configured to report js errors...

Under its simplest form, you could just have :
<body onload="alert('Loaded !')"> in your ASPX page.

Patrice

--
 
G

Guest

a-ha!
i just put a message box in the form load and it is being called...
....obviously a problem with the resize function

thanks!
a.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top