Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Finding Control

Finding Control

Scheduled Pinned Locked Moved ASP.NET
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tarik Guney
    wrote on last edited by
    #1

    Hi, My page contains several radiobutton controls and i want it to write checked radio button's id on the page.but how can we find checked radio button control by looping not using if or switch conditions or something. i gotta handle it with looping. Thanks and Regards...

    T G C 3 Replies Last reply
    0
    • T Tarik Guney

      Hi, My page contains several radiobutton controls and i want it to write checked radio button's id on the page.but how can we find checked radio button control by looping not using if or switch conditions or something. i gotta handle it with looping. Thanks and Regards...

      T Offline
      T Offline
      Tarik Guney
      wrote on last edited by
      #2

      I hope some body help me as possible as :)

      1 Reply Last reply
      0
      • T Tarik Guney

        Hi, My page contains several radiobutton controls and i want it to write checked radio button's id on the page.but how can we find checked radio button control by looping not using if or switch conditions or something. i gotta handle it with looping. Thanks and Regards...

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        atarikg wrote:

        i gotta handle it with looping.

        You can't do that. There is no collection of selected radio buttons that you can loop through. There isn't even a collection of radio buttons. There is a collection of form elements, you have to loop through that to find the radio buttons, then check each one of them to see if it is selected.

        --- single minded; short sighted; long gone;

        1 Reply Last reply
        0
        • T Tarik Guney

          Hi, My page contains several radiobutton controls and i want it to write checked radio button's id on the page.but how can we find checked radio button control by looping not using if or switch conditions or something. i gotta handle it with looping. Thanks and Regards...

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          atarikg wrote:

          i gotta handle it with looping.

          No, you don't. There's actually a findcontrol method, or you can use recursion to find the controls that have the right names, or even to find all radio buttons, if you want to find all the radio buttons that may be checked, or if there can only be one.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          T 1 Reply Last reply
          0
          • C Christian Graus

            atarikg wrote:

            i gotta handle it with looping.

            No, you don't. There's actually a findcontrol method, or you can use recursion to find the controls that have the right names, or even to find all radio buttons, if you want to find all the radio buttons that may be checked, or if there can only be one.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            T Offline
            T Offline
            Tarik Guney
            wrote on last edited by
            #5

            So there are any sample codes ? I wish you had given some sample codes or articles' adresses..:(

            C 1 Reply Last reply
            0
            • T Tarik Guney

              So there are any sample codes ? I wish you had given some sample codes or articles' adresses..:(

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              http://weblogs.asp.net/eporter/archive/2007/02/24/asp-net-findcontrol-recursive-with-generics.aspx[^]

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups