473,394 Members | 1,841 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,394 software developers and data experts.

ViewState Not Maintained In Refresh

Hello,

I have a web page, which is being refresh after every
30 secs.Now, there is also a datagrid in it, which i bind
in the pageload event.
Now the problem is when the page is refresh after 30 secs
the datagrid loses it's values.
I mean it does not maintain it's viewstate.

Why is it?

Is it bcuz refresh is not the same as Postback.
buz in postback viewstate is miantained.

Cheers...

Nov 19 '05 #1
1 2288
When you refresh, you are calling the page via a GET, not a POST. Postback
events are POST (the form is posting (sending info) to the server).So, yes,
the viewstate is rebuilt as there is no POST event to send the viewstate
contents to the server.

NOTE: Viewstate is a hidden, encrypted tag in your page. It is not some form
of magic.

Possible solutions:

1. Post everytime a user changes anything (this could get heavy)
2. Use Ajax (Asynch JavaScript and XML) to update the data without a full
page refresh

Since you are refreshing at a rather rapid rate, you may still end up with a
situation where the user changes something and it is not reflected. Thus, one
other solution:

3. Change from meta refresh to a JavaScript POST refresh.

Before doing anything, ask if the 30 second automatic refresh is a mandatory
part of your application.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"batista" wrote:
Hello,

I have a web page, which is being refresh after every
30 secs.Now, there is also a datagrid in it, which i bind
in the pageload event.
Now the problem is when the page is refresh after 30 secs
the datagrid loses it's values.
I mean it does not maintain it's viewstate.

Why is it?

Is it bcuz refresh is not the same as Postback.
buz in postback viewstate is miantained.

Cheers...

Nov 19 '05 #2

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

Similar topics

9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
1
by: John | last post by:
Hi all, I have a problem with viewstate being maintained. I use LoadControl to load a user control and the data is sent down to the client correctly. However, when I change some data and post...
1
by: John | last post by:
Hi all, I have a problem with viewstate being maintained. I use LoadControl to load a user control and the data is sent down to the client correctly. However, when I change some data and post...
10
by: neo | last post by:
hi, I am studying ASP.NET and have few questions - 1) The session ID and values of controls is stored in VIEWSTATE variable. So now when we put EnableViewState="false" in Page directive and...
2
by: Prodip Saha | last post by:
I am sure there is an easy fix for this problem. I am reloading the same page at an interval using the meta refresh tag in aspx page. This page has one textbox and one button. The problem is -when...
5
by: Steven Licciardi | last post by:
I have an aspx page with nothing in it but one literal, which I populate with straight forward html (the html consists of about 25 tables with approx. 30 rows each and two columns with text in each...
2
by: fabrice | last post by:
Hi, I have a trouble with my TextBox Control and it's ViewState in my form... The property for it, is FALSE as following : <form id="frmSearchBre4" runat="Server"> <asp:textbox id="myID"...
10
by: Lloyd Dupont | last post by:
When you define UserControl in source code the sample I see are often like that: ============ public string Text { get { String s = (String)ViewState; return ((s == null) ? String.Empty : s);...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.