Dynamic Checkbox

Discussion in 'ASP .Net' started by Raymond, Jun 21, 2007.

  1. Raymond

    Raymond Guest

    I am having a problem about the dynamic checkbox
    Private Sub Page_Load
    Me.NumberOfChkControls = 0
    Dim cbCheckBox As New CheckBox
    cbCheckBox.Text = .Id.ToString
    cbCheckBox.ID = "ControlID_" + NumberOfChkControls.ToString
    NumberOfChkControls = NumberOfChkControls + 1
    cbCheckBox.EnableViewState = True
    dimNewTableCell.Controls.Add(cbCheckBox)
    dimNewTableRow.Cells.Add(dimNewTableCell)
    End Sub

    Property NumberOfChkControls() As Integer
    Get
    Return viewstate("NumChkcontrls")
    End Get
    Set(ByVal Value As Integer)
    viewstate("NumChkcontrls") = Value
    End Set
    End Property


    This is just a simply of my current source code
    and there should have a for loop to generate a lot of checkbox
    according how about record in the database
    when user select checkbox and press button,basically it work well in
    the WinXP platform.
    but when i put it to windows Server 2003, it either will select the
    wrong record to manipulate or doesnt work at all
    can somebody help me?
     
    Raymond, Jun 21, 2007
    #1
    1. Advertising

  2. On Jun 21, 12:43 pm, Raymond <> wrote:
    > I am having a problem about the dynamic checkbox
    > Private Sub Page_Load
    > Me.NumberOfChkControls = 0
    > Dim cbCheckBox As New CheckBox
    > cbCheckBox.Text = .Id.ToString
    > cbCheckBox.ID = "ControlID_" + NumberOfChkControls.ToString
    > NumberOfChkControls = NumberOfChkControls + 1
    > cbCheckBox.EnableViewState = True
    > dimNewTableCell.Controls.Add(cbCheckBox)
    > dimNewTableRow.Cells.Add(dimNewTableCell)
    > End Sub
    >
    > Property NumberOfChkControls() As Integer
    > Get
    > Return viewstate("NumChkcontrls")
    > End Get
    > Set(ByVal Value As Integer)
    > viewstate("NumChkcontrls") = Value
    > End Set
    > End Property
    >
    > This is just a simply of my current source code
    > and there should have a for loop to generate a lot of checkbox
    > according how about record in the database
    > when user select checkbox and press button,basically it work well in
    > the WinXP platform.
    > but when i put it to windows Server 2003, it either will select the
    > wrong record to manipulate or doesnt work at all
    > can somebody help me?


    Do you have the same ASP.NET version installed on a both servers?
     
    Alexey Smirnov, Jun 21, 2007
    #2
    1. Advertising

  3. Raymond

    Raymond Guest

    On Jun 21, 8:17 pm, Alexey Smirnov <> wrote:
    > On Jun 21, 12:43 pm, Raymond <> wrote:
    >
    >
    >
    >
    >
    >
    >
    > > I am having a problem about the dynamic checkbox
    > > Private Sub Page_Load
    > > Me.NumberOfChkControls = 0
    > > Dim cbCheckBox As New CheckBox
    > > cbCheckBox.Text = .Id.ToString
    > > cbCheckBox.ID = "ControlID_" + NumberOfChkControls.ToString
    > > NumberOfChkControls = NumberOfChkControls + 1
    > > cbCheckBox.EnableViewState = True
    > > dimNewTableCell.Controls.Add(cbCheckBox)
    > > dimNewTableRow.Cells.Add(dimNewTableCell)
    > > End Sub

    >
    > > Property NumberOfChkControls() As Integer
    > > Get
    > > Return viewstate("NumChkcontrls")
    > > End Get
    > > Set(ByVal Value As Integer)
    > > viewstate("NumChkcontrls") = Value
    > > End Set
    > > End Property

    >
    > > This is just a simply of my current source code
    > > and there should have a for loop to generate a lot of checkbox
    > > according how about record in the database
    > > when user select checkbox and press button,basically it work well in
    > > the WinXP platform.
    > > but when i put it to windows Server 2003, it either will select the
    > > wrong record to manipulate or doesnt work at all
    > > can somebody help me?

    >
    > Do you have the same ASP.NET version installed on a both servers?


    I install the same .net framework for both servers.
    Please help. I stuck on this issues for a few weeks.
     
    Raymond, Jun 22, 2007
    #3
  4. Raymond

    Raymond Guest

    On Jun 21, 8:17 pm, Alexey Smirnov <> wrote:
    > On Jun 21, 12:43 pm, Raymond <> wrote:
    >
    >
    >
    >
    >
    >
    >
    > > I am having a problem about the dynamic checkbox
    > > Private Sub Page_Load
    > > Me.NumberOfChkControls = 0
    > > Dim cbCheckBox As New CheckBox
    > > cbCheckBox.Text = .Id.ToString
    > > cbCheckBox.ID = "ControlID_" + NumberOfChkControls.ToString
    > > NumberOfChkControls = NumberOfChkControls + 1
    > > cbCheckBox.EnableViewState = True
    > > dimNewTableCell.Controls.Add(cbCheckBox)
    > > dimNewTableRow.Cells.Add(dimNewTableCell)
    > > End Sub

    >
    > > Property NumberOfChkControls() As Integer
    > > Get
    > > Return viewstate("NumChkcontrls")
    > > End Get
    > > Set(ByVal Value As Integer)
    > > viewstate("NumChkcontrls") = Value
    > > End Set
    > > End Property

    >
    > > This is just a simply of my current source code
    > > and there should have a for loop to generate a lot of checkbox
    > > according how about record in the database
    > > when user select checkbox and press button,basically it work well in
    > > the WinXP platform.
    > > but when i put it to windows Server 2003, it either will select the
    > > wrong record to manipulate or doesnt work at all
    > > can somebody help me?

    >
    > Do you have the same ASP.NET version installed on a both servers?


    I installed the same .Net framework for the both Server.
    Previous when it cant pass the value during re-created the dynamic
    checkbox.
    please help...
     
    Raymond, Jun 22, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    0
    Views:
    529
    tshad
    Apr 15, 2005
  2. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,404
    ThunderMusic
    Jan 25, 2006
  3. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    830
    David Wier
    Oct 6, 2006
  4. pizzy
    Replies:
    0
    Views:
    167
    pizzy
    Mar 23, 2005
  5. pizzy
    Replies:
    5
    Views:
    384
    pizzy
    Apr 12, 2005
Loading...

Share This Page