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

asp:Table & ViewState

Hi,

I have a problem, and it seems I have an error in my logic ...

First I add a Table control on my webform (EnableViewState is True by
default).
Then I retrive some information vie QueryString (in the !isPostBack part of
the Page_Load event) and use those information (in code behind, in
!isPostBack part of Page_LOad event) to add some rows and cells to Table I
added moment ago.
Whenever a PostBack occurs the Table get 'reseted', and I don't see the data
anymore ...

Why is this happening since Table is part of webform (not beening created
dinamicaly) and EnabledViewState is set to True ?

thanx, Neven
Nov 19 '05 #1
1 1343
Rows and cells need to be re-added on postback - this information isn't
stored in the viewstate.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Neven Klofutar" <neven.klofutar*r.e..mo*****@vip.hr> wrote in message
news:ut**************@tk2msftngp13.phx.gbl...
Hi,

I have a problem, and it seems I have an error in my logic ...

First I add a Table control on my webform (EnableViewState is True by
default).
Then I retrive some information vie QueryString (in the !isPostBack part
of the Page_Load event) and use those information (in code behind, in
!isPostBack part of Page_LOad event) to add some rows and cells to Table I
added moment ago.
Whenever a PostBack occurs the Table get 'reseted', and I don't see the
data anymore ...

Why is this happening since Table is part of webform (not beening created
dinamicaly) and EnabledViewState is set to True ?

thanx, Neven

Nov 19 '05 #2

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

Similar topics

0
by: Stephen | last post by:
I have been getting on well with help from this forum trying to create an array list and work with it. Everything is working fine apart from displaying my array list items into the labels in my...
3
by: Maria | last post by:
Hi I have a asp:table that I want to hold the values between postbacks. Hope some one knows how I can get that to work in an easy way. The table is loaded in runtime with different textboxes....
3
by: Marty McDonald | last post by:
I have <asp:Table... </asp:Table> on my webform. In codebehind, I populate a DataTable whose data should appear in the asp:Table. I created my own code to populate the asp:Table with the...
4
by: stb | last post by:
I have an empty asp:table on a form. Rows and cells in the rows are added programatically. At the end of each row, there is a cell with a button inside it. How do I catch the button's click...
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...
0
by: Davey P | last post by:
I have an asp.net table which I am populating with controls dynamically at runtime. The controls themselves get/set values in a datatable which is stored in viewstate over postbacks. Here is...
4
by: Nathan Sokalski | last post by:
When editing an ASP Table, Visual Studio does not allow me to edit it in Design View. This makes it harder to add elements, because I must add every element either by using Design View to create...
2
by: clickon | last post by:
I am confused about the way in which asp:table objects work. When a control is within an asp table it generally appears to be in the scope of the tables parent control. E.g. if i have a page that...
1
by: stoogots2 | last post by:
If I am adding rows to a table I have created (using the designer) in my code-behind, I am doing a Table.Rows.Count after the onClick event and even though the table definition properties are set...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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...

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.