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. Preventing post back on selected item of RadioButtonList

Preventing post back on selected item of RadioButtonList

Scheduled Pinned Locked Moved ASP.NET
question
5 Posts 4 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.
  • I Offline
    I Offline
    I Never Look Behind
    wrote on last edited by
    #1

    Hi! i have a RadioButtonList & bind it to data source. now it has three radio button. whose text is X, Y & Z. i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?

    N S F 3 Replies Last reply
    0
    • I I Never Look Behind

      Hi! i have a RadioButtonList & bind it to data source. now it has three radio button. whose text is X, Y & Z. i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      I Never Look Behind wrote:

      i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?

      Upto my knowledge NO. Because radiobuttonlist will be rendered as individual HTML radio buttons. Once you made AutoPostback to true, ASP.NET will add a javascript function to this radio buttons for posting the form. So you won't be able to call your javascript function on radiobutton click to prevent page from posting. To do this I suggest use individual radio buttons. If you don't know the number of radio button's at design time, then put a ContentPlaceHolder and add radio button controls there with your custom javascript function to post data.


      My Website | Ask smart questions

      1 Reply Last reply
      0
      • I I Never Look Behind

        Hi! i have a RadioButtonList & bind it to data source. now it has three radio button. whose text is X, Y & Z. i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        Yes Navneeth is right instead of using the radiobutton List you can use radio buttins with same name attribute. if you have written any javascript then doucment.getElementByName will return you all same name radiobuttons Now here you can make auotpost back property true or false to any radio button

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        1 Reply Last reply
        0
        • I I Never Look Behind

          Hi! i have a RadioButtonList & bind it to data source. now it has three radio button. whose text is X, Y & Z. i have make autopostback property TURE of RadioButtonList . now i want when i select third radio button having text Z,there should no post back & on selecting on X & Y there should no post back. is it possible?

          F Offline
          F Offline
          firozu
          wrote on last edited by
          #4

          If you are adding individual radio buttons to RadioButtonList at run-time then, before adding a radio button, set its "AutoPostBack" property to 'TRUE' or 'FALSE' as per your requirement.

          I 1 Reply Last reply
          0
          • F firozu

            If you are adding individual radio buttons to RadioButtonList at run-time then, before adding a radio button, set its "AutoPostBack" property to 'TRUE' or 'FALSE' as per your requirement.

            I Offline
            I Offline
            I Never Look Behind
            wrote on last edited by
            #5

            GOOD! Thanks.

            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