how to count selected radio button from radiobutton list according to selection?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mayur pawar
    New Member
    • Feb 2013
    • 2

    how to count selected radio button from radiobutton list according to selection?

    My name is Mayur.. I am doing the online voting system project.my question is if i have 3 radiobutton when i am selected any button, it will be counting every time according to selection..
    ex..
    who will be the future prime minister of india,aco..to u?
    -->radiobuttonlis t
    1..rahul gandhi
    2..narendra modi
    3..sharad pawar
    when i will select 2nd option,then count will de increment of narendra modi..any one select 1st option,then count will be increment of rahul gandhi..and so on..
    please give me the soln in asp.net using c#
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Have you tried handling the RadioButtonList 's SelectedIndexCh anged Event?

    Put your logic in the method that handles that event.

    Comment

    • mayur pawar
      New Member
      • Feb 2013
      • 2

      #3
      i tried switch case.but it select only the answer. i want increment the counter.you please tell me which method i will used.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Store the count information in session so that you can increment/decrement the count as necessary during postback.

        -Frinny

        Comment

        Working...