473,396 Members | 1,792 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.

Add a new row dynamically to a table

Hello,

I have created a dynamic webcontrol table with several rows. I also have a
ImageButton which
adds a new row to the table. After I have added a new row, and I click the
ImageButton again
I get: "Multiple controls with id '_ctl0' was found ..."

This is what I have done:

page_init:

Check if the table is persisted in a Session variable, if it is then
add it to a placeholder control.

page_load:

If not postback then get the data and render the table and save it
to a Session variable. The Session variable is used in the page_init method
to re-create the dynamic table

I always initialize the imagebutton and adds the eventhandler for the
ImageBtton_onClick.

The error message appers after the page_init method has executed.

I donīt set any ID on the controls in the cells or rows. I let ASP.NET
handle that for me.

Can someone give me any pointers or hints what might be wrong ?

Regards,

// Henke
Nov 18 '05 #1
1 1517
Jos
Henke wrote:
Hello,

I have created a dynamic webcontrol table with several rows. I also
have a ImageButton which
adds a new row to the table. After I have added a new row, and I
click the ImageButton again
I get: "Multiple controls with id '_ctl0' was found ..."

This is what I have done:

page_init:

Check if the table is persisted in a Session variable, if it is then
add it to a placeholder control.

page_load:

If not postback then get the data and render the table and save it
to a Session variable. The Session variable is used in the page_init
method to re-create the dynamic table

I always initialize the imagebutton and adds the eventhandler for the
ImageBtton_onClick.

The error message appers after the page_init method has executed.

I donīt set any ID on the controls in the cells or rows. I let ASP.NET
handle that for me.

Can someone give me any pointers or hints what might be wrong ?

Regards,

// Henke


I guess the error is caused by the recreation from Session.
As a general rule, you should not use Session to persist your table, but
Viewstate.

--

Jos
Nov 18 '05 #2

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

Similar topics

5
by: john_williams_800 | last post by:
Hi; I am just starting to use the DOM to do some more advanced javascripting so please be patient with my question if it is an ignorant question. I would like to use the DOM to dynamically...
3
by: Kiyomi | last post by:
Hello, I create a Table1 dynamically at run time, and at the same time, I would like to create LinkButton controls, also dynamically, and insert them into each line in my Table1. I would...
0
by: Diane Yocom | last post by:
I'm very new to ASP.Net and probably jumped in a little over my head, but... I'm trying to create a user control that will control navigation through my site. It's sortof like Amazon.com, where...
2
by: buran | last post by:
Dear ASP.NET Programmers, I have a HTML table (running as server control with the control ID: tblInsertSP). The table has 16 rows with textboxes. Depending on the value of the ddlSPType, which...
2
by: Chad | last post by:
I have a problem that I am desperate to understand. It involves dynamically adding controls to a Table control that is built as a result of performing a database query. I am not looking to...
2
by: grawsha2000 | last post by:
Hello, How can I add a table to asp.net page dynamically with Code Behind style. I still can't find a way of doing it. This really causes me a big problem when I deal with records from...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
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
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
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...

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.