473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PostBack before ViewState loaded in Browser give incorrect result

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

May 31 '07 #1
1 1199
the __viewstate hidden field is rendered right after the <formbefore
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)

sc*******@gmail.com wrote:
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
May 31 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stephen | last post by:
I have the following code working in order to create an array list and populate a datagrid however everytime i click my button the first item in the array and the first row in the datagrid are...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
1
by: John Cosmas | last post by:
I've got a page which loads up a different user control into a placeholder control every time a button is clicked on the parent page. I use a statement like...
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
2
by: mivhaelveloz | last post by:
I thought I had a good grip on viewstate handling, but am suprised by a small test: In my aspx file I have a PlaceHolder control and a button for posting back. Dynamically in Page_Load I...
9
by: Alexander van Doormalen | last post by:
I have a situation that user controls are dynamically loaded within a page. To know which control to 're-add' to the page I saved the control path in the ViewState. This Control is added using...
0
by: John Smith | last post by:
I still have not gotten this damn thing figured out and I'm asking for help one last time before I give up on it. I have a user control that contains a paged gridview control. The master page...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
4
by: Dan | last post by:
Hi, i'm not sure to understand the difference between refreshing the pagina by clicking on 'refresh' in the browser and a postback. What i think it is: Suppose a page with a form containing a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.