473,505 Members | 15,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTMLTable

I have a .aspx page with a server side table...i am adding rows to this table on submit of some button...something like this

Sub AddRow(Sender As Object, E As EventArgs)
..
..
..
MyTable.Rows.Add(r)
End Sub
however between calls to this function, I am not able to maintain the state...my table initially has 2 rows...then i add one...so now there are three rows...now when I add more rows the last row gets overwritten...The count property of Rows also remains constant at 3...immediately after adding row it shows count as 4, but when I am back into this function it is reset to 3...does any body have any idea about why this would happen?

Thanks!!!
Nov 18 '05 #1
1 1319
It sounds like you are performing a PostBack "between calls to this
function." As HTTP is stateless, the page class has to be rebuilt from
scratch with each Request (or PostBack). Therefore, if you add a row with a
PostBack, you have to re-add it with each successive PostBack.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Vikram" <an*******@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
I have a .aspx page with a server side table...i am adding rows to this table on submit of some button...something like this
Sub AddRow(Sender As Object, E As EventArgs)
.
.
.
MyTable.Rows.Add(r)
End Sub
however between calls to this function, I am not able to maintain the state...my table initially has 2 rows...then i add one...so now there are
three rows...now when I add more rows the last row gets overwritten...The
count property of Rows also remains constant at 3...immediately after adding
row it shows count as 4, but when I am back into this function it is reset
to 3...does any body have any idea about why this would happen?
Thanks!!!

Nov 18 '05 #2

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

Similar topics

3
7222
by: Ajay Desh | last post by:
Hi I am gettin error, if i try to find the top position of a table. Here is what i am doing.I have a HtmlTable (Table3 is the name/id) created.It has a position and a Top and Left co-ordinates...
1
1943
by: Jeremy Ames | last post by:
Ok, so I am still trying to get use to ADO.Net, but I have come leaps and bounds to this point. I am trying to bind a dataset that I have returned from a webservice to a HtmlTable. It appears that...
2
403
by: Michael Meckelein | last post by:
Hi all! I have a table like Table myTable = new Table(); Now, I want to publish the table as part of a webpage and as part of a word document. I tried to convert the table, but the compiler...
2
2852
by: suzy | last post by:
what is the difference between a htmltable control and a table control i know one is server control and the other is not, but when would each be used? also, how do you set the class of a html...
2
6273
by: Alfred Salton | last post by:
Can anyone show me how to set the css class of an HtmlTable control in code on the server? I can't find any indication that the css class is a property of the HtmlTable, HtmlTableRow and...
2
1642
by: Jay | last post by:
I have been trying to link and HTML Table to a Code behind variable. I have seen people saying that they can do this but I cannot get it to work. What am i missing? In the HTML Code I have:...
1
4756
by: Leo | last post by:
I created a user control which is some text contained in a HtmlTable. I put this control into main form. I would like to have the ability to move this control around in the main form. I think one...
1
2450
by: TRobran | last post by:
What I'm trying to do seems pretty straightforward so I must be missing something simple. Any help is greatly appreciated. On my page I have a DropDownList, a HtmlTable and a Button. Each row...
0
2277
by: redaudi | last post by:
I'm hoping someone might be able to help me with the following issue. Basically I'm creating a htmltable on the fly and then simply populating it with rows and cells accordingly. My test site ...
0
1246
by: purnimakarnati | last post by:
Hi All, Can anybody solve my problem. I created a HTMLTable with a dataset by a method called addTable(dataset) After creating a new table and new row I am adding cells and in each cell I am...
0
7216
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
7098
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
7367
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...
1
7018
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
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.