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

Problem with viewstate updating Dynamic Table contents

1) I build a Html Table dynamically (Header Row, and then 2 rows with data
All 2 rows have 2 cells: cell(0) contains a delete button (ASP Button),
cell(1) contains a HTML Text box
2) On Form Load and get some data from a dataset and then from it's contents
build the page

At this point the page is rendered and 2 rows are displayed. There is an Add
button that a user can click to add another row to the table. This works fine
and the row is added.

Now if the user clicks the delete button in row 2 the form is posted back, I
rebuild the page, and then in the click event for the delete button remove
the row from the table and the dataset. All appears to be fine at this point.

Now if the user clicks the add button again another row is added, but this
time row 2's textbox has the wrong value. It appears to be related to the
view state. I think the view state somehow is not getting cleared when the
row is removed.

Any help would be appreciated
Jan 5 '06 #1
1 2973

gaDev wrote:
1) I build a Html Table dynamically (Header Row, and then 2 rows with data
All 2 rows have 2 cells: cell(0) contains a delete button (ASP Button),
cell(1) contains a HTML Text box
2) On Form Load and get some data from a dataset and then from it's contents
build the page

At this point the page is rendered and 2 rows are displayed. There is an Add
button that a user can click to add another row to the table. This works fine
and the row is added.

Now if the user clicks the delete button in row 2 the form is posted back, I
rebuild the page, and then in the click event for the delete button remove
the row from the table and the dataset. All appears to be fine at this point.

Now if the user clicks the add button again another row is added, but this
time row 2's textbox has the wrong value. It appears to be related to the
view state. I think the view state somehow is not getting cleared when the
row is removed.

Any help would be appreciated


As this is a classic asp newsgroup, you will probably find more help at
a dotnet group. I'd recommend
microsoft.public.dotnet.framework.aspnet.

/P.

Jan 5 '06 #2

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

Similar topics

6
by: Robin Bonin | last post by:
In my user contol I am creating a set of dropdownlists. Each list is created based on input from the other lists. The problem I am having is setting the selected index on the lists. If someone...
6
by: hb | last post by:
Hi, I have a page bill.aspx and its code-behind bill.aspx.cs. On bill.aspx I have: === Select a month: <asp:dropdownlist runat="server" id="lstDate" autopostback="True" /> <br> <asp:table...
3
by: eSapient | last post by:
I created a web page which contains a form which contains a table. The number of rows for the table are determined dynamically. The first cell of each row contains a HyperLink control and the last...
1
by: pbb | last post by:
I'm creating a set of dynamic controls on a webpage by calling my BuildControls sub in the Page_Init sub. I recreate the controls by calling the BuildControls sub in the LoadViewState override...
3
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users...
6
by: hlubocky | last post by:
I thought I had a good grasp of the problem related to dynamically creating controls, but it appears that as my application grew in complexity, the problem has resurfaced. As I understand it, in...
1
by: Andrew Robinson | last post by:
I have a <asp:table> control with a large number of dynamically created LinkButtons. I am using the command event, command name and command argument values in my LinkButtons to trigger actions...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
6
by: shashi shekhar singh | last post by:
Respected Sir, I have to create multiple dynamic dropdownlist boxes and add items dynamically in <asp:table> server control but problem occurs , i.e. except of fist dropdown list no dropdownlist...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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?

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.