Any suggestions/comments/workarounds will be very welcome. Many thanks Andrew More background to this here: Hi Andrew, Thank you for posting. And from the description in this thread, I noticed that you said the problem behavior occurs in the following two cases: 1.
Grid View Enable View State=False ========================= This is an expected behavior when Enable View State= false, because for ASP.
First, create a web-application using Visual-Studio 2005 or later.
(Note: For visual-studio 2005, we’ll have to make this web-application ajax enabled by selecting “Asp . Do note that in case of visual studio 2008, it has an in-built support for ajax, so there is no need to specify anything extra.) Now, in Design-Mode, Add “Timer” and “Update-Panel” controls from “Ajax Extensions” tab of Toolbox. Add the Grid View control inside the Update-Panel Control.
This function is use to fetch data from the Student Record table, fills data in a Data Table object and find it to a Grid View control using the Data Source property.
In this code below code, you see database table columns binding with the bound fields and formatting is provided using the template fields.
The below is my connection string which is stored in web.config file. If you are using my database, just copy and paste the code or use the attached application.
You can change this connection string according to your SQL server database setting. If you want use my database file then attach that file. If you are using your database, you need to replace column binding with your database table columns.
We use gridview to view data in tabular format on the web page.
If the web page is not reloaded for some time, and somedata manipulation(insert/update/delete) occurs at backend, then the viewer is presented with older(wrong) data.
Is there a way to stop this happening without having to Enable View State?
This would add completely unnecessary overhead to the page.
NET template datbound controls (such as Data Gird, Grid View, Data List...), after databinding, the data and related nested control properties are persisted in View State, so that when the page postback, those info are get restored from viewstate without redo the databinding.