Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
<b></b>This is my code. I want to insert the selected radio button value when clicked on NEXT button. Kindly help me with the aspx.cs code for the same.
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">

    <LayoutTemplate>
    <table>
    <asp:PlaceHolder runat="server" ID="itemplaceholder" />
    </table>
    </LayoutTemplate>
    <ItemTemplate>

    <tr>
    <td>

    <img src='QuestionImages/<%#Eval("image") %>' height="1000" width="1000" />
    </td>
    </tr>

    <tr>
    <td>
     <asp:Label text='<%#Eval("Question") %>' runat="server" />
    </td>
    </tr>
    <tr>

    <td>
    <asp:RadioButton ID="option1" text='<%#Eval("Option1") %>' runat="server" GroupName="r1" />
    </td>
    </tr>
    <tr>
    <td>
    <asp:RadioButton  ID="option2" text='<%#Eval("Option2") %>' runat="server" GroupName="r1"/>
    </td>
    </tr>
    <tr>
    <td>
    <asp:RadioButton ID="option3"  text='<%#Eval("Option3") %>' runat="server" GroupName="r1"/>
    </td>
    </tr>
    <tr>
    <td>
    <asp:RadioButton ID="option4" text='<%#Eval("Option4") %>' runat="server" GroupName="r1"/>
    </td>

    </tr>



    </ItemTemplate>

    </asp:ListView>
Posted
Comments
Thanks7872 21-May-15 5:53am    
All the above code is unnecessary. I don't see any code where you are trying to insert something.
siddartha kopparapu 21-May-15 6:22am    
Why using list view you can use RadioButtonList and have a selected index changed event there?
Sinisa Hajnal 21-May-15 6:43am    
Kindly show your insert code.

Also, there is RadioButtonList control that gives you its selected button value

1 solution

Use Item Check event and get the values accordingly and later it can be saved into the database
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900