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

Viewstate of Dynamically Generated Table Rowss ??

With an ASP page you can add a webform textbox and button (ie not HTML ones)
an cause something to be appended to the textbox everytime the button is
presssed because the textbox Enableviewstate property is true (??)

I have created a webform table and have modified code from MSDN (Jan)
library such that when a button is pressed, rows are appended. I have
programmatically enabled viewstate for the cells and the row added. The
problem is that each time the button is pressed the previusly added rows are
lost; ie no viewstate.

<For the dynamic table code search in MSDN library for TableRow class and
take the Overview. Note that this code has the script in the HTML section
interacting with a HTML table. With little effort it can be co-opted to
interact with a webform table placed in an ASPX code behind page>

Any ideas ?? Thx
--
David Jones
Senior Lecturer
School of Electrical & Computer Engineering
RMIT University
+61 3 99255318
Nov 19 '05 #1
2 2809
David:
You need to recreate table rows and cells..So when the button is clicked
once, you add the row/cells. When it's clicked a 2nd time, you add the
initial row/cell and then the new row/cell....and so on. Typically you keep
track of how many times the button is clicked by keeping a value in the
viewstate.

You can use denis bauer's DynamicPlaceHolder
(http://www.denisbauer.com/ASPNETCont...aceholder.aspx,
free) but the site has been done for a couple days (it's always up and
down).

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"David Jones" <da*******@rmit.edu.au.nospamplease> wrote in message
news:F6**********************************@microsof t.com...
With an ASP page you can add a webform textbox and button (ie not HTML ones) an cause something to be appended to the textbox everytime the button is
presssed because the textbox Enableviewstate property is true (??)

I have created a webform table and have modified code from MSDN (Jan)
library such that when a button is pressed, rows are appended. I have
programmatically enabled viewstate for the cells and the row added. The
problem is that each time the button is pressed the previusly added rows are lost; ie no viewstate.

<For the dynamic table code search in MSDN library for TableRow class and
take the Overview. Note that this code has the script in the HTML section
interacting with a HTML table. With little effort it can be co-opted to
interact with a webform table placed in an ASPX code behind page>

Any ideas ?? Thx
--
David Jones
Senior Lecturer
School of Electrical & Computer Engineering
RMIT University
+61 3 99255318

Nov 19 '05 #2
Thanks for that.
On reading elsewhere I had a fely that was the case.

What a bummer though.
It means that you have maintain the state (content) of those added controls
yourself.

"Karl Seguin" wrote:
David:
You need to recreate table rows and cells..So when the button is clicked
once, you add the row/cells. When it's clicked a 2nd time, you add the
initial row/cell and then the new row/cell....and so on. Typically you keep
track of how many times the button is clicked by keeping a value in the
viewstate.

You can use denis bauer's DynamicPlaceHolder
(http://www.denisbauer.com/ASPNETCont...aceholder.aspx,
free) but the site has been done for a couple days (it's always up and
down).

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"David Jones" <da*******@rmit.edu.au.nospamplease> wrote in message
news:F6**********************************@microsof t.com...
With an ASP page you can add a webform textbox and button (ie not HTML

ones)
an cause something to be appended to the textbox everytime the button is
presssed because the textbox Enableviewstate property is true (??)

I have created a webform table and have modified code from MSDN (Jan)
library such that when a button is pressed, rows are appended. I have
programmatically enabled viewstate for the cells and the row added. The
problem is that each time the button is pressed the previusly added rows

are
lost; ie no viewstate.

<For the dynamic table code search in MSDN library for TableRow class and
take the Overview. Note that this code has the script in the HTML section
interacting with a HTML table. With little effort it can be co-opted to
interact with a webform table placed in an ASPX code behind page>

Any ideas ?? Thx
--
David Jones
Senior Lecturer
School of Electrical & Computer Engineering
RMIT University
+61 3 99255318


Nov 19 '05 #3

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

Similar topics

2
by: theo | last post by:
Hi... I wish to extract the text content of an Xml file and assign it to DropDownList controls at runtime.I can get the Xml file text content into the DropDownList controls (Ex...if 5 Xml text...
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...
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...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
6
by: hitendra15 | last post by:
Hi I have created web user control which has Repeater control and Linkbutton in ItemTemplate of repeater control, following is the code for this control On first load it runs fine but when...
2
by: Jarod | last post by:
Hey I change backColor of linkButton in my Page_Load: lbDoSth.BackColor = Color.Red; But I have multiView on this page. On one of the views I have detailsView. When I add a new row a set...
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...
0
by: nithagowda | last post by:
Hello, I have a DropDownList for source type and a panel for displaying TreeView based on the source type.. The problem is- if i select different source type drom ddlSrcType, other than the...
1
by: chris | last post by:
I have an ASP.NET web page which contains a dynamically generated table. The user checks a checkbox in one or more rows and then clicks an OK button which then passes the selected row numbers to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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,...

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.