Loading ...
Sorry, an error occurred while loading the content.
 

How to get selected values from dynamically generated CheckBoxList? (ASP.NET)

Expand Messages
  • sugunsg <sugunsg@yahoo.com>
    Hi, I am generating the CheckBoxList control in Run-Time (in ASP.NET ). I dont know how to get the selected check box values from dynamically generated
    Message 1 of 2 , Dec 26, 2002
      Hi,
      I am generating the CheckBoxList control in Run-Time (in ASP.NET ). I
      dont know
      how to get the selected check box values from dynamically generated
      checkBoxList.
      (I know how to select the values from CheckBoxList if it is desined
      at runtime)
      I tried to use FindControl method but FindControl method returns NULL.

      Look the code to generate the CheckBoxList in Run Time.

      In Code behind...

      CheckBoxList ChkMachines = new CheckBoxList();
      ChkMachines.ID = "ChkMachines_" + <some variable>
      ChkMachines.DataValueField="MECH_ID";
      ChkMachines.DataTextField="MECHNAME";
      ChkMachines.RepeatColumns=2;
      ChkMachines.DataSource = ReaderMech;
      ChkMachines.DataBind();
      // MECH_ID, MECHNAME is data base fields
      // ReaderMech is OleDBDataReader

      // tbale Row and cell are generated dynamically

      TableRow tRowMach = new TableRow();
      Table2.Rows.Add(tRowMech);
      TableCell tCellMech = new TableCell();
      tRowMech.Cells.Add(tCellMech);
      // then the CheckBoxList Control is added in the table cell
      tCellMach.Controls.Add(ChkMachines);

      I put the above code in loop.

      The CheckBoxLists are generated with out any problem. But I want to
      know ,How to access the selected checkbox values from the
      dynamically generated CheckBoxList?
      If any one knows Help me to solve this.

      Thanks
      sugumar
    • Adwait Ullal
      Since you ve posted an ASP.NET issue on SOAPBuilders list, you may not receive any responses. Try lists at: http://discuss.develop.com
      Message 2 of 2 , Dec 26, 2002
        Since you've posted an ASP.NET issue on SOAPBuilders list, you may not
        receive any responses.

        Try lists at:

        http://discuss.develop.com
        http://groups.yahoo.com/group/CSharpNET/

        HTH

        - Adwait

        Adwait Ullal

        e: mailto:adwait@...
        w: http://www.adwait.com





        ----Original Message Follows----
        From: "sugunsg <sugunsg@...>" <sugunsg@...>
        Reply-To: soapbuilders@yahoogroups.com
        To: soapbuilders@yahoogroups.com
        Subject: [soapbuilders] How to get selected values from dynamically
        generated CheckBoxList? (ASP.NET)
        Date: Fri, 27 Dec 2002 03:54:26 -0000

        Hi,
        I am generating the CheckBoxList control in Run-Time (in ASP.NET ). I
        dont know
        how to get the selected check box values from dynamically generated
        checkBoxList.
        (I know how to select the values from CheckBoxList if it is desined
        at runtime)
        I tried to use FindControl method but FindControl method returns NULL.

        Look the code to generate the CheckBoxList in Run Time.

        In Code behind...

        CheckBoxList ChkMachines = new CheckBoxList();
        ChkMachines.ID = "ChkMachines_" + <some variable>
        ChkMachines.DataValueField="MECH_ID";
        ChkMachines.DataTextField="MECHNAME";
        ChkMachines.RepeatColumns=2;
        ChkMachines.DataSource = ReaderMech;
        ChkMachines.DataBind();
        // MECH_ID, MECHNAME is data base fields
        // ReaderMech is OleDBDataReader

        // tbale Row and cell are generated dynamically

        TableRow tRowMach = new TableRow();
        Table2.Rows.Add(tRowMech);
        TableCell tCellMech = new TableCell();
        tRowMech.Cells.Add(tCellMech);
        // then the CheckBoxList Control is added in the table cell
        tCellMach.Controls.Add(ChkMachines);

        I put the above code in loop.

        The CheckBoxLists are generated with out any problem. But I want to
        know ,How to access the selected checkbox values from the
        dynamically generated CheckBoxList?
        If any one knows Help me to solve this.

        Thanks
        sugumar



        -----------------------------------------------------------------
        This group is a forum for builders of SOAP implementations to discuss
        implementation and interoperability issues. Please stay on-topic.

        To unsubscribe from this group, send an email to:
        soapbuilders-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


        _________________________________________________________________
        MSN 8: advanced junk mail protection and 3 months FREE*.
        http://join.msn.com/?page=features/junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU=
        http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_advancedjmf_3mf
      Your message has been successfully submitted and would be delivered to recipients shortly.