PostBack before ViewState loaded in Browser give incorrect result

S

scolemann

Hi All,

I've noticed that if I click a button before the viewstate has been
transferred to the browser, the viewstate information posted back is
none or part of the ViewState. I verified this using the Fiddler tool
to monitor the requests sent to the server.

This postback causes havoc on the page because the expected data was
missing from the viewstate. Is there a way to ensure that the
viewstate is loaded at the top of the page? This would slow down
loading the graphical elements of the site, but would ensure it worked
correctly.

Thanks,
Cole
 
B

bruce barker

the __viewstate hidden field is rendered right after the <form> before
other controls. its a good as it gets. your viewstate is probably too large.

if this is a real problem, setup a onsubmit hander and a onload hander
in javascript. have the onload set a variable, the on submit can cancel
the submit if onload has not fired.

-- bruce (sqlwork.com)
 

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

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top