473,406 Members | 2,549 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,406 software developers and data experts.

Add HTML Rows in a html table

TR
Hi! I have a webpage with a htmltable and a button in it.
When I push the button, I want to insert a new row with a cell in the
table. With my code I can add a row the first time a push the button,
but the second time nothing happens when I push the buttom. Why is it
like this? and how to make this possible? I have this code under my
buttons click event in my behind code class:

Dim r As New HtmlTableRow
r.Visible = True

Dim c As New HtmlTableCell
c.Visible = True
c.Attributes.Add("class", "Inmatning")
r.Cells.Add(c)

Table2.Rows.Insert(Table2.Rows.Count, r)

How to do if I want a row to be added EVERY time i push the button,
not only the first time?
Nov 18 '05 #1
1 1760
On 20 Oct 2004 02:47:00 -0700, i0*****@utb.hb.se (TR) wrote:
Hi! I have a webpage with a htmltable and a button in it.
When I push the button, I want to insert a new row with a cell in the
table. With my code I can add a row the first time a push the button,
but the second time nothing happens when I push the buttom. Why is it
like this? and how to make this possible? I have this code under my
buttons click event in my behind code class:

Dim r As New HtmlTableRow
r.Visible = True

Dim c As New HtmlTableCell
c.Visible = True
c.Attributes.Add("class", "Inmatning")
r.Cells.Add(c)

Table2.Rows.Insert(Table2.Rows.Count, r)

How to do if I want a row to be added EVERY time i push the button,
not only the first time?


When you push the button a postback takes place, returning the page to
it's original state, you must add any rows that were subsequently
added dynamically in the OnLoad method of the page.

You could have a look at this custom control that will better maintain
the ViewState of your dynamic table:

http://www.denisbauer.com/ASPNETCont...aceholder.aspx

Hope this helps

Blu.
Nov 18 '05 #2

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

Similar topics

1
by: anonieko | last post by:
This example applies to javascript, table, cells, rows > > How do you access rows and columns of a HTML table? > > > <script language="javascript"> alert('start');
0
by: Subba Rao via DotNetMonster.com | last post by:
---------------------------HTML---------------------------------------- <html> <head> <title>:: DHTML Table Demo ::</title> <script langauge="javascript" src="InterchangeRows.js"></script>...
6
by: Ashok | last post by:
Hi, I am starting a new project to build a software product using APS.NET 2.0. In past I have used "frameset" and "frame" to build pages. My current requirements I have coded using frameset and...
2
by: sarafat | last post by:
greetings people I am new to Ajax and javascript, yet i have little time to learn it all. Question is: i am using javascript to create my DOM Table and AJAX that returns a DataSet to my...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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:
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.