Creating a new table at runtime

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Homer

    #1

    Creating a new table at runtime

    Is it possible to user a string to create the name for a new control on a web page

    e.g

    dim myTableName as strin
    myTableName = "blah

    and then use the myTableName value as the name of the datagrid or table contro

    Many thank

    Homer
  • Cor

    #2
    Re: Creating a new table at runtime

    Hi Homer,

    But you have to set a Panel on the page first to place it on.

    I hope this helps?

    Cor
    \\\
    Private Sub Page_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArg s) Handles MyBase.Load
    Dim mybutton(31) As Button
    Dim i As Integer
    For i = 0 To New Date().DaysInMo nth _
    (New Date().Year, New Date().Month) - 1
    mybutton(i) = New Button
    mybutton(i).Bac kColor = Drawing.Color.W hite
    mybutton(i).Tex t = (i + 1).ToString
    mybutton(i).Wid th = New Unit(30)
    Me.Panel1.Contr ols.Add(mybutto n(i))
    AddHandler mybutton(i).Cli ck, AddressOf mybutton_Click
    If (i + 1) Mod 5 = 0 Then
    Me.Panel1.Contr ols.Add(New LiteralControl( "<BR>"))
    End If
    Next
    End Sub
    Private Sub mybutton_Click _
    (ByVal sender As Object, ByVal e As System.EventArg s)
    Dim mylabel As New Label
    Me.Panel1.Contr ols.Add(New LiteralControl( "<BR><BR>") )
    Me.Panel1.Contr ols.Add(mylabel )
    mylabel.Text = "The day is: " & DirectCast(send er, Button).Text
    End Sub
    ///


    Comment

    Working...