473,404 Members | 2,195 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,404 software developers and data experts.

Table Ignores EnableViewState

I have a table that I dynamically populate by creating cells and rows. The
data comes from a database so I would prefer to have the table store the
data in its viewstate rather than having to repopulate it on every postback.

But it doesn't work. I ensure the table's EnableViewState is true. But
whenever there's a postback and I don't repopulate the table, it disappears.
I'm thinking this has something to do with my dynamic data not being stored
in the table's viewstate. But I'm not sure why or what the best workaround
is.

Any tips?

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Jan 27 '08 #1
1 1336
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>I have a table that I dynamically populate by creating cells and rows. The
data comes from a database so I would prefer to have the table store the
data in its viewstate rather than having to repopulate it on every
postback.

But it doesn't work. I ensure the table's EnableViewState is true. But
whenever there's a postback and I don't repopulate the table, it
disappears. I'm thinking this has something to do with my dynamic data not
being stored in the table's viewstate.
It's not your dynamic data as such - it's that dynamically added controls
(in this case, <trand <td>) don't survive a postback, and need to be
recreated every time the page loads...
Any tips?
Use a GridView...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 28 '08 #2

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

Similar topics

0
by: Dave Verwer | last post by:
Hi I have a problem which is easily reproducable using VS.NET 2003 and the .Net framework 1.1 (not tested with framework 1.0) regarding disabling ViewState for dynamically created controls. ...
0
by: Bryan Donaldson | last post by:
I have a table on my web form, declared like this: <asp:table id="tblOverrides" runat="server" enableviewstate=true" cssclass="clsTable"> <asp:tablerow cssclass="clsTblHeader"> <asp:tablecell ...
4
by: Grigs | last post by:
Hello, I have an asp:table on my page. I am, after a button gets clicked, programmatically adding rows and their cells. Using the Cell.Text = to put the value in the cell. I then have another...
6
by: AFN | last post by:
I have a server-side table, <asp:table id="tblData" EnableViewState="true" runat="server" /> and my code-behind adds rows of data to the table in code that says: if not page.ispostback then...
1
by: AC | last post by:
Hello, All Is it possible to set enableViewState='true' for single control on a page with enableViewState='false'. In particular I am interested in DropDownList, but neither using IDE to set...
3
by: Joe | last post by:
Hello all: From what I understand the ItemCommand, UpdateCommand, SortCommand, etc events for the datagrid require that the datagrid's enableVireState property is set to true. Does the...
7
by: Just D. | last post by:
Does anybody know any good solution to avoid this setting to be enabled? I guess Microsoft doesn't care of the Internet connection of the potential client working with asp.net. This EnableViewState...
2
by: toddw607 | last post by:
Hi Everyone! I have a ASP.NET webform that brings data in from SQL Server 2000 and displays it on a page. I want to update the webpage while in IE using the following code: <%@ Import...
21
tsubasa
by: tsubasa | last post by:
I am working on a wish list where users add products to their list for future purhcases. I am using a GridView to display the records by users after they have login to the shopping cart. How can I...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.