Create table at run time.

A

Anil

I am developing an app in ASP 3.0
I want to create a table with some text boxes at run time, so that when i
press a command button on the page, some rows and columns should be created
on the page.
Please help me on how to create these html table tags at run time. If anyone
can point to a sample, it would be good.
Thanks a lot!
 
C

Cor Ligthert

Hi Anil,

A ver simple sample from buttons and a calender at run time I once made.
I hope this helps?

Cor

\\\It needs a "Panel1" on a page.
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim mybutton(31) As Button
Dim i As Integer
For i = 0 To New Date().DaysInMonth _
(New Date().Year, New Date().Month) - 1
mybutton(i) = New Button
mybutton(i).BackColor = Drawing.Color.White
mybutton(i).Text = (i + 1).ToString
mybutton(i).Width = New Unit(30)
Me.Panel1.Controls.Add(mybutton(i))
AddHandler mybutton(i).Click, AddressOf mybutton_Click
If (i + 1) Mod 5 = 0 Then
Me.Panel1.Controls.Add(New LiteralControl("<BR>"))
End If
Next
End Sub
Private Sub mybutton_Click _
(ByVal sender As Object, ByVal e As System.EventArgs)
Dim mylabel As New Label
Me.Panel1.Controls.Add(New LiteralControl("<BR><BR>"))
Me.Panel1.Controls.Add(mylabel)
mylabel.Text = "The day is: " & DirectCast(sender, Button).Text
End Sub
///
 
A

Anil

Thanks Cor. But I need it through HTML tags.
I am making an ASP page with coding in InterDev!!
Please give me some link that has this.
Thanks a lot!!
 
C

Cor Ligthert

Hi Anil,

That you can do using javascript and the "document.write" however that has
nothing to do with dotnet.

I would look for that if I was you in an Interdev and/or ASP newsgroup.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top